Commit bb08f1c7 authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

[Android] Take over pref changes from settings opt-in

|prefs::kContextualSearchEnabled| is added to the list of synced
prefs that are observed during settings opt-in.

Bug: 933647
Change-Id: I3db775f98127286971cd5a1e3b2d5ddeee583959
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538530Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644786}
parent cc79be37
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<!-- Note: If a synced pref is added/removed from this file, the method
|GetSyncedServicePrefNames| in
chrome/browser/unified_consent/unified_consent_service_factory.cc has to be
updated accordingly. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<org.chromium.chrome.browser.preferences.SignInPreference <org.chromium.chrome.browser.preferences.SignInPreference
android:key="sign_in" android:key="sign_in"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/browser/unified_consent/unified_consent_service_factory.h" #include "chrome/browser/unified_consent/unified_consent_service_factory.h"
#include "build/build_config.h"
#include "chrome/browser/prefs/pref_service_syncable_util.h" #include "chrome/browser/prefs/pref_service_syncable_util.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/signin/identity_manager_factory.h"
...@@ -26,12 +27,20 @@ namespace { ...@@ -26,12 +27,20 @@ namespace {
// Returns the synced pref names of the services on the "Sync and Google // Returns the synced pref names of the services on the "Sync and Google
// services" settings page. // services" settings page.
// Note: The synced prefs returned by this method have to match the prefs // Note: The synced prefs returned by this method have to match the prefs
// shown in personalization_options.html. // shown in
// chrome/browser/resources/settings/privacy_page/personalization_options.html
// on Desktop and chrome/android/java/res/xml/sync_and_services_preferences.xml
// on Android.
std::vector<std::string> GetSyncedServicePrefNames() { std::vector<std::string> GetSyncedServicePrefNames() {
return {prefs::kSearchSuggestEnabled, prefs::kAlternateErrorPagesEnabled, return {
prefs::kSafeBrowsingEnabled, prefs::kSearchSuggestEnabled, prefs::kAlternateErrorPagesEnabled,
prefs::kSafeBrowsingScoutReportingEnabled, prefs::kSafeBrowsingEnabled, prefs::kSafeBrowsingScoutReportingEnabled,
spellcheck::prefs::kSpellCheckUseSpellingService}; spellcheck::prefs::kSpellCheckUseSpellingService,
#if defined(OS_ANDROID)
prefs::kContextualSearchEnabled
#endif
};
} }
} // namespace } // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment