| Index: chrome/browser/extensions/external_policy_loader.cc
|
| diff --git a/chrome/browser/extensions/external_policy_loader.cc b/chrome/browser/extensions/external_policy_loader.cc
|
| index a93fe0f6ff37ca9882e8b9672f9c019c1f7391b8..4364aad0e98ebd35f95e7ecef73f6fb933c782f0 100644
|
| --- a/chrome/browser/extensions/external_policy_loader.cc
|
| +++ b/chrome/browser/extensions/external_policy_loader.cc
|
| @@ -79,28 +79,23 @@ void ExternalPolicyLoader::Observe(
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| if (profile_ == NULL) return;
|
| - switch (type) {
|
| - case chrome::NOTIFICATION_PREF_CHANGED: {
|
| - if (content::Source<PrefService>(source).ptr() == profile_->GetPrefs()) {
|
| - std::string* pref_name = content::Details<std::string>(details).ptr();
|
| - if (*pref_name == prefs::kExtensionInstallForceList) {
|
| - StartLoading();
|
| - } else {
|
| - NOTREACHED() << "Unexpected preference name.";
|
| - }
|
| - }
|
| - break;
|
| - }
|
| - case chrome::NOTIFICATION_PROFILE_DESTROYED: {
|
| - if (content::Source<Profile>(source).ptr() == profile_) {
|
| - notification_registrar_.RemoveAll();
|
| - pref_change_registrar_.RemoveAll();
|
| - profile_ = NULL;
|
| - }
|
| - break;
|
| + DCHECK(type == chrome::NOTIFICATION_PROFILE_DESTROYED) <<
|
| + "Unexpected notification type.";
|
| + if (content::Source<Profile>(source).ptr() == profile_) {
|
| + notification_registrar_.RemoveAll();
|
| + pref_change_registrar_.RemoveAll();
|
| + profile_ = NULL;
|
| + }
|
| +}
|
| +
|
| +void ExternalPolicyLoader::OnPreferenceChanged(PrefServiceBase* service,
|
| + const std::string& pref_name) {
|
| + if (service == profile_->GetPrefs()) {
|
| + if (pref_name == prefs::kExtensionInstallForceList) {
|
| + StartLoading();
|
| + } else {
|
| + NOTREACHED() << "Unexpected preference name.";
|
| }
|
| - default:
|
| - NOTREACHED() << "Unexpected notification type.";
|
| }
|
| }
|
|
|
|
|