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

Unified Diff: chrome/browser/profiles/profile_keyed_base_factory.cc

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to PrefRegistrySyncable and PrefServiceSyncable to let sync know of pre-registered prefs. Created 7 years, 10 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
Index: chrome/browser/profiles/profile_keyed_base_factory.cc
diff --git a/chrome/browser/profiles/profile_keyed_base_factory.cc b/chrome/browser/profiles/profile_keyed_base_factory.cc
index 1a38c08f2d7a57ef2fcaf34413baddd52ffaf6f8..858cdadf1e0dd1e3fe823e312d16a8fa8888d644 100644
--- a/chrome/browser/profiles/profile_keyed_base_factory.cc
+++ b/chrome/browser/profiles/profile_keyed_base_factory.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/profiles/profile_keyed_base_factory.h"
+#include "chrome/browser/prefs/pref_registry_syncable.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_dependency_manager.h"
@@ -76,7 +78,13 @@ void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile(Profile* profile) {
std::set<Profile*>::iterator it = registered_preferences_.find(profile);
if (it == registered_preferences_.end()) {
- RegisterUserPrefs(profile->GetPrefs());
+ PrefService* prefs = profile->GetPrefs();
+ PrefRegistrySyncable* registry = static_cast<PrefRegistrySyncable*>(
+ prefs->DeprecatedGetPrefRegistry());
+ RegisterUserPrefs(registry);
+ // A few registration functions still need the PrefService pointer
+ // (e.g. to clear preferences).
+ DeprecatedRegisterUserPrefs(prefs, registry);
Mattias Nissler (ping if slow) 2013/02/06 17:53:33 Yikes, hacks over hacks here. I'll have to think a
Jói 2013/02/07 14:52:32 Yeah, when I ran into this I thought "oops" :) Bu
Mattias Nissler (ping if slow) 2013/02/08 11:26:56 So, I wonder whether we'd be better off if we just
registered_preferences_.insert(profile);
}
}

Powered by Google App Engine
This is Rietveld 408576698