From bbcd971d24135196ceee9804e51e31d8dc7f7730 Mon Sep 17 00:00:00 2001 From: Emerick Rogul Date: Fri, 3 Oct 2025 16:10:04 -0400 Subject: [PATCH] [cr142] Disable `ImageService` now that `page_image_service::kImageService` feature flag is gone We used to disable `ImageService` via the `page_image_service::kImageService` feature flag, but that feature flag was removed recently. Instead, we should disable `ImageService` completely by always denying consent in `ImageServiceConsentHelper::GetConsentStatus`. Chromium changes: https://source.chromium.org/chromium/chromium/src/+/fdbc6e177df72cab865004e8589b067d3222d20f commit fdbc6e177df72cab865004e8589b067d3222d20f Author: Irina Date: Thu Sep 25 15:03:17 2025 -0700 [Code Health] Cleanup ImageService feature Fixed: 356237096 Change-Id: Ie65e759b04b9e5ab18a643440bef4c584edb8e6d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6975064 Reviewed-by: Marlon Facey Reviewed-by: Caroline Rising Reviewed-by: Brandon Wylie Reviewed-by: David Roger Commit-Queue: Irina Fedorova Reviewed-by: Adam Arcaro Cr-Commit-Position: refs/heads/main@{#1520905} --- .../image_service_consent_helper.cc | 19 +++++++++++++++++++ test/filters/components_unittests.filter | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 chromium_src/components/page_image_service/image_service_consent_helper.cc diff --git a/chromium_src/components/page_image_service/image_service_consent_helper.cc b/chromium_src/components/page_image_service/image_service_consent_helper.cc new file mode 100644 index 00000000000..aef1c20390f --- /dev/null +++ b/chromium_src/components/page_image_service/image_service_consent_helper.cc @@ -0,0 +1,19 @@ +/* Copyright (c) 2025 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 "components/sync/service/sync_service_utils.h" + +namespace syncer { +bool RejectConsent() { + return true; +} +} // namespace syncer + +#define GetUploadToGoogleState(...) \ + RejectConsent() || syncer::GetUploadToGoogleState(__VA_ARGS__) + +#include + +#undef GetUploadToGoogleState diff --git a/test/filters/components_unittests.filter b/test/filters/components_unittests.filter index f33b8490e4a..72a5bb39f8d 100644 --- a/test/filters/components_unittests.filter +++ b/test/filters/components_unittests.filter @@ -90,6 +90,11 @@ # switches::kSyncEnableBookmarksInTransportMode -InitialAccountBookmarkDeduplicatorTest.* +# These tests fail because we patch ImageServiceConsentHelper::GetConsentStatus +# to return false always +-ImageServiceConsentHelperTest.* +-ImageServiceImplTest.* + # Tests below this point have not been diagnosed or had issues created yet. -AccountInvestigatorTest.* -AccountReconcilorDiceTest.*