Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4100)

Unified Diff: chrome/browser/sync/sync_prefs.cc

Issue 8334030: Merge search engines sync data type with Preferences. Sync the default search provider. Add some ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Merge to TOT and fixed additional conflicts from rsimha. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/resources/configure.html ('k') | chrome/browser/sync/sync_prefs_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_prefs.cc
===================================================================
--- chrome/browser/sync/sync_prefs.cc (revision 109292)
+++ chrome/browser/sync/sync_prefs.cc (working copy)
@@ -134,11 +134,12 @@
return registered_types;
}
- // Remove autofill_profile since it's controlled by autofill (see
- // code below).
+ // Remove autofill_profile since it's controlled by autofill, and
+ // search_engines since it's controlled by preferences (see code below).
syncable::ModelTypeSet user_selectable_types(registered_types);
DCHECK_EQ(user_selectable_types.count(syncable::NIGORI), 0u);
user_selectable_types.erase(syncable::AUTOFILL_PROFILE);
+ user_selectable_types.erase(syncable::SEARCH_ENGINES);
// Remove app_notifications since it's controlled by apps (see
// code below).
@@ -155,13 +156,19 @@
}
}
- // Set autofill_profile to the same enabled/disabled state as
- // autofill (since only autofill is shown on the UI).
+ // Group the enabled/disabled state of autofill_profile with autofill, and
+ // search_engines with preferences (since only autofill and preferences are
+ // shown on the UI).
if (registered_types.count(syncable::AUTOFILL) &&
registered_types.count(syncable::AUTOFILL_PROFILE) &&
GetDataTypePreferred(syncable::AUTOFILL)) {
preferred_types.insert(syncable::AUTOFILL_PROFILE);
}
+ if (registered_types.count(syncable::PREFERENCES) &&
+ registered_types.count(syncable::SEARCH_ENGINES) &&
+ GetDataTypePreferred(syncable::PREFERENCES)) {
+ preferred_types.insert(syncable::SEARCH_ENGINES);
+ }
// Set app_notifications to the same enabled/disabled state as
// apps (since only apps is shown on the UI).
@@ -202,6 +209,16 @@
preferred_types_with_dependents.erase(syncable::APP_NOTIFICATIONS);
}
}
+ // Set search_engines to the same enabled/disabled state as
+ // preferences (since only preferences is shown in the UI).
+ if (registered_types.count(syncable::PREFERENCES) &&
+ registered_types.count(syncable::SEARCH_ENGINES)) {
+ if (preferred_types_with_dependents.count(syncable::PREFERENCES)) {
+ preferred_types_with_dependents.insert(syncable::SEARCH_ENGINES);
+ } else {
+ preferred_types_with_dependents.erase(syncable::SEARCH_ENGINES);
+ }
+ }
for (syncable::ModelTypeSet::const_iterator it = registered_types.begin();
it != registered_types.end(); ++it) {
« no previous file with comments | « chrome/browser/sync/resources/configure.html ('k') | chrome/browser/sync/sync_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698