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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 11377131: Removing PrefObserver usage, batch 4. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 8 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/extensions/extension_service.h ('k') | chrome/browser/extensions/external_policy_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 52147fc5eeae2872019bda05cb9c0bce76dc62af..20888a22d66dedd8db373c95f9c39da607be6952 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -387,8 +387,11 @@ ExtensionService::ExtensionService(Profile* profile,
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
content::NotificationService::AllBrowserContextsAndSources());
pref_change_registrar_.Init(profile->GetPrefs());
- pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, this);
- pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, this);
+ base::Closure callback =
+ base::Bind(&ExtensionService::OnExtensionInstallPrefChanged,
+ base::Unretained(this));
+ pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, callback);
+ pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, callback);
// Set up the ExtensionUpdater
if (autoupdate_enabled) {
@@ -2710,11 +2713,7 @@ void ExtensionService::Observe(int type,
}
}
-void ExtensionService::OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) {
- DCHECK(pref_name == prefs::kExtensionInstallAllowList ||
- pref_name == prefs::kExtensionInstallDenyList)
- << "Unexpected preference name " << pref_name;
+void ExtensionService::OnExtensionInstallPrefChanged() {
IdentifyAlertableExtensions();
CheckManagementPolicy();
}
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/external_policy_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698