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

Unified Diff: chrome/browser/prefs/pref_service_syncable.cc

Issue 1096833003: Convert PrefSyncStatus into PrefRegistrationFlags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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/prefs/pref_service_syncable.h ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_service_syncable.cc
diff --git a/chrome/browser/prefs/pref_service_syncable.cc b/chrome/browser/prefs/pref_service_syncable.cc
index 0a8613c84e2954faffe09f2d30ba404dcd2a8836..856d46cda65458f20ce40b506a80f43b6b574d57 100644
--- a/chrome/browser/prefs/pref_service_syncable.cc
+++ b/chrome/browser/prefs/pref_service_syncable.cc
@@ -55,13 +55,11 @@ PrefServiceSyncable::PrefServiceSyncable(
base::Unretained(this)));
// Add already-registered syncable preferences to PrefModelAssociator.
- const user_prefs::PrefRegistrySyncable::PrefToStatus& syncable_preferences =
- pref_registry->syncable_preferences();
- for (user_prefs::PrefRegistrySyncable::PrefToStatus::const_iterator it =
- syncable_preferences.begin();
- it != syncable_preferences.end();
- ++it) {
- AddRegisteredSyncablePreference(it->first.c_str(), it->second);
+ for (PrefRegistry::const_iterator it = pref_registry->begin();
+ it != pref_registry->end(); ++it) {
+ const std::string& path = it->first;
+ AddRegisteredSyncablePreference(
+ path.c_str(), pref_registry_->GetRegistrationFlags(path));
}
// Watch for syncable preferences registered after this point.
@@ -162,17 +160,14 @@ void PrefServiceSyncable::RemoveSyncedPrefObserver(
priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
}
-void PrefServiceSyncable::AddRegisteredSyncablePreference(
- const char* path,
- const user_prefs::PrefRegistrySyncable::PrefSyncStatus sync_status) {
+void PrefServiceSyncable::AddRegisteredSyncablePreference(const char* path,
+ uint32 flags) {
DCHECK(FindPreference(path));
- if (sync_status == user_prefs::PrefRegistrySyncable::SYNCABLE_PREF) {
+ if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_PREF) {
pref_sync_associator_.RegisterPref(path);
- } else if (sync_status ==
+ } else if (flags &
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF) {
priority_pref_sync_associator_.RegisterPref(path);
- } else {
- NOTREACHED() << "invalid sync_status: " << sync_status;
}
}
« no previous file with comments | « chrome/browser/prefs/pref_service_syncable.h ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698