| Index: chrome/browser/content_settings/content_settings_default_provider.cc
|
| diff --git a/chrome/browser/content_settings/content_settings_default_provider.cc b/chrome/browser/content_settings/content_settings_default_provider.cc
|
| index 28fd5cd674dd194ade9c0dd0c284349e07a0630f..6a3e97fa252b2cdb65e5cdc343b98e906095970e 100644
|
| --- a/chrome/browser/content_settings/content_settings_default_provider.cc
|
| +++ b/chrome/browser/content_settings/content_settings_default_provider.cc
|
| @@ -276,37 +276,31 @@ void DefaultProvider::ShutdownOnUIThread() {
|
| prefs_ = NULL;
|
| }
|
|
|
| -void DefaultProvider::Observe(int type,
|
| - const content::NotificationSource& source,
|
| - const content::NotificationDetails& details) {
|
| +void DefaultProvider::OnPreferenceChanged(PrefServiceBase* service,
|
| + const std::string& name) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| - if (type == chrome::NOTIFICATION_PREF_CHANGED) {
|
| - DCHECK_EQ(prefs_, content::Source<PrefService>(source).ptr());
|
| - if (updating_preferences_)
|
| - return;
|
| -
|
| - std::string* name = content::Details<std::string>(details).ptr();
|
| - if (*name == prefs::kDefaultContentSettings) {
|
| - ReadDefaultSettings(true);
|
| - } else if (*name == prefs::kGeolocationDefaultContentSetting) {
|
| - MigrateObsoleteGeolocationPref();
|
| - // Return and don't send a notifications. Migrating the obsolete
|
| - // geolocation pref will change the prefs::kDefaultContentSettings and
|
| - // cause the notification to be fired.
|
| - return;
|
| - } else {
|
| - NOTREACHED() << "Unexpected preference observed";
|
| - return;
|
| - }
|
| -
|
| - NotifyObservers(ContentSettingsPattern(),
|
| - ContentSettingsPattern(),
|
| - CONTENT_SETTINGS_TYPE_DEFAULT,
|
| - std::string());
|
| + DCHECK_EQ(prefs_, service);
|
| + if (updating_preferences_)
|
| + return;
|
| +
|
| + if (name == prefs::kDefaultContentSettings) {
|
| + ReadDefaultSettings(true);
|
| + } else if (name == prefs::kGeolocationDefaultContentSetting) {
|
| + MigrateObsoleteGeolocationPref();
|
| + // Return and don't send a notifications. Migrating the obsolete
|
| + // geolocation pref will change the prefs::kDefaultContentSettings and
|
| + // cause the notification to be fired.
|
| + return;
|
| } else {
|
| - NOTREACHED() << "Unexpected notification";
|
| + NOTREACHED() << "Unexpected preference observed";
|
| + return;
|
| }
|
| +
|
| + NotifyObservers(ContentSettingsPattern(),
|
| + ContentSettingsPattern(),
|
| + CONTENT_SETTINGS_TYPE_DEFAULT,
|
| + std::string());
|
| }
|
|
|
| void DefaultProvider::ReadDefaultSettings(bool overwrite) {
|
|
|