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 7f52e3d0c9b4303f1977692b4abb42c520033028..40f286ef93a18812728fc438fec9aafad6392c74 100644 |
--- a/chrome/browser/profiles/profile_keyed_base_factory.cc |
+++ b/chrome/browser/profiles/profile_keyed_base_factory.cc |
@@ -8,6 +8,7 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_dependency_manager.h" |
#include "components/user_prefs/pref_registry_syncable.h" |
+#include "components/user_prefs/user_prefs.h" |
ProfileKeyedBaseFactory::ProfileKeyedBaseFactory( |
const char* name, ProfileDependencyManager* manager) |
@@ -52,7 +53,7 @@ Profile* ProfileKeyedBaseFactory::GetProfileToUse(Profile* profile) { |
return profile; |
} |
-void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile(Profile* profile) { |
+void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile(content::BrowserContext* profile) { |
// Safe timing for pref registration is hard. Previously, we made Profile |
// responsible for all pref registration on every service that used |
// Profile. Now we don't and there are timing issues. |
@@ -76,9 +77,9 @@ void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile(Profile* profile) { |
// parallel) and we don't want to register multiple times on the same profile. |
DCHECK(!profile->IsOffTheRecord()); |
- std::set<Profile*>::iterator it = registered_preferences_.find(profile); |
+ std::set<content::BrowserContext*>::iterator it = registered_preferences_.find(profile); |
if (it == registered_preferences_.end()) { |
- PrefService* prefs = profile->GetPrefs(); |
+ PrefService* prefs = components::UserPrefs::Get(profile); |
PrefRegistrySyncable* registry = static_cast<PrefRegistrySyncable*>( |
prefs->DeprecatedGetPrefRegistry()); |
RegisterUserPrefs(registry); |
@@ -102,7 +103,7 @@ bool ProfileKeyedBaseFactory::ServiceIsNULLWhileTesting() const { |
return false; |
} |
-void ProfileKeyedBaseFactory::ProfileDestroyed(Profile* profile) { |
+void ProfileKeyedBaseFactory::ProfileDestroyed(content::BrowserContext* profile) { |
// While object destruction can be customized in ways where the object is |
// only dereferenced, this still must run on the UI thread. |
DCHECK(CalledOnValidThread()); |
@@ -110,12 +111,12 @@ void ProfileKeyedBaseFactory::ProfileDestroyed(Profile* profile) { |
registered_preferences_.erase(profile); |
} |
-bool ProfileKeyedBaseFactory::ArePreferencesSetOn(Profile* profile) const { |
+bool ProfileKeyedBaseFactory::ArePreferencesSetOn(content::BrowserContext* profile) const { |
return registered_preferences_.find(profile) != |
registered_preferences_.end(); |
} |
-void ProfileKeyedBaseFactory::MarkPreferencesSetOn(Profile* profile) { |
+void ProfileKeyedBaseFactory::MarkPreferencesSetOn(content::BrowserContext* profile) { |
DCHECK(!ArePreferencesSetOn(profile)); |
registered_preferences_.insert(profile); |
} |