diff --git a/build/args/brave_defaults.gni b/build/args/brave_defaults.gni index 3f89a602f2f..c5cab54e9c1 100644 --- a/build/args/brave_defaults.gni +++ b/build/args/brave_defaults.gni @@ -27,6 +27,3 @@ enable_pseudolocales = false # Our copy of signature_generator.py doesn't support --ignore_missing_cert: ignore_missing_widevine_signing_cert = false - -# Disabling this feature completely, as it is broken in Brave anyway. -enable_pdf_save_to_drive = false diff --git a/chromium_src/pdf/pdf_features.cc b/chromium_src/pdf/pdf_features.cc new file mode 100644 index 00000000000..dfd637a391d --- /dev/null +++ b/chromium_src/pdf/pdf_features.cc @@ -0,0 +1,17 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "base/feature_override.h" + +#include + +namespace chrome_pdf::features { + +OVERRIDE_FEATURE_DEFAULT_STATES({{ + {kPdfSaveToDrive, base::FEATURE_DISABLED_BY_DEFAULT}, + {kPdfSaveToDriveSurvey, base::FEATURE_DISABLED_BY_DEFAULT}, +}}); + +} // namespace chrome_pdf::features diff --git a/components/ai_chat/content/browser/pdf_text_helper_unittest.cc b/components/ai_chat/content/browser/pdf_text_helper_unittest.cc index 7ca7561f8d2..752ac25b5ed 100644 --- a/components/ai_chat/content/browser/pdf_text_helper_unittest.cc +++ b/components/ai_chat/content/browser/pdf_text_helper_unittest.cc @@ -39,6 +39,11 @@ class FakePdfListener : public pdf::mojom::PdfListener { GetMostVisiblePageIndex, (GetMostVisiblePageIndexCallback), (override)); + MOCK_METHOD(void, + GetSaveDataBufferHandlerForDrive, + (pdf::mojom::SaveRequestType, + GetSaveDataBufferHandlerForDriveCallback), + (override)); }; class TestPdfDocumentHelperClient : public pdf::PDFDocumentHelperClient {