[cr149] kPdfSaveToDrive disabled by default

This feature has been broken in brave, and because of that it was
disabled before with a build flag. In M149 that build flag doesn't
produce a coherent build anymore, so we fall back to overriding the
feature flag.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/dd6626cdd58e0ccd306599507de9a47e5a2573e9

commit dd6626cdd58e0ccd306599507de9a47e5a2573e9
Author: April Kallmeyer <ask@chromium.org>
Date:   Fri Apr 24 15:25:16 2026 -0700

    [PDF Ink Signatures] Call the new pdfViewerPrivate.getTextInfo() API

    Pass the results of getTextInfo() to the backend on text annotation
    commit and cache which fonts were already loaded.

    Ink2Manager keeps track of the IDs previously sent and will not
    repeatedly send the same font data to the backend to load, and it will
    tell the getTextInfo() private API not to serialize the known fonts. The
    backend is expected to save and reuse the font data from the frontend.

    Bug: 408976049
    Co-Authored-By: Lei Zhang <thestig@chromium.org>
    Change-Id: Ifcfd99dcae3d05f5ce5d49f81130ccb9f0cdb731
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7728778
    Commit-Queue: April Kallmeyer <ask@chromium.org>
    Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
    Reviewed-by: Lei Zhang <thestig@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1620509}
This commit is contained in:
Claudio DeSouza
2026-05-22 16:57:43 -04:00
committed by Max Karolinskiy
parent 4ea2cec784
commit 486ffb9112
3 changed files with 22 additions and 3 deletions
-3
View File
@@ -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
+17
View File
@@ -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 <pdf/pdf_features.cc>
namespace chrome_pdf::features {
OVERRIDE_FEATURE_DEFAULT_STATES({{
{kPdfSaveToDrive, base::FEATURE_DISABLED_BY_DEFAULT},
{kPdfSaveToDriveSurvey, base::FEATURE_DISABLED_BY_DEFAULT},
}});
} // namespace chrome_pdf::features
@@ -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 {