Index: chrome/browser/content_settings/content_settings_policy_provider.cc |
diff --git a/chrome/browser/content_settings/content_settings_policy_provider.cc b/chrome/browser/content_settings/content_settings_policy_provider.cc |
index a13ca7724a898b9690856df2a28af3a53cf49f33..b1197d601948ade93cae05904423a2944a768f84 100644 |
--- a/chrome/browser/content_settings/content_settings_policy_provider.cc |
+++ b/chrome/browser/content_settings/content_settings_policy_provider.cc |
@@ -17,7 +17,6 @@ |
#include "chrome/common/chrome_notification_types.h" |
#include "chrome/common/pref_names.h" |
#include "content/browser/browser_thread.h" |
-#include "content/common/notification_details.h" |
#include "content/common/notification_service.h" |
#include "content/common/notification_source.h" |
#include "webkit/plugins/npapi/plugin_group.h" |
@@ -277,12 +276,12 @@ void PolicyProvider::RegisterUserPrefs(PrefService* prefs) { |
PrefService::UNSYNCABLE_PREF); |
} |
-PolicyProvider::PolicyProvider(HostContentSettingsMap* map, |
+PolicyProvider::PolicyProvider(Observer* observer, |
PrefService* prefs, |
DefaultProviderInterface* default_provider) |
- : host_content_settings_map_(map), |
- prefs_(prefs), |
+ : prefs_(prefs), |
default_provider_(default_provider) { |
+ AddObserver(observer); |
ReadManagedContentSettings(false); |
pref_change_registrar_.Init(prefs_); |
@@ -428,22 +427,11 @@ void PolicyProvider::ClearAllContentSettingsRules( |
void PolicyProvider::ShutdownOnUIThread() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ RemoveAllObservers(); |
if (!prefs_) |
return; |
pref_change_registrar_.RemoveAll(); |
prefs_ = NULL; |
- host_content_settings_map_ = NULL; |
-} |
- |
-void PolicyProvider::NotifyObservers( |
- const ContentSettingsDetails& details) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- if (host_content_settings_map_ == NULL) |
- return; |
- NotificationService::current()->Notify( |
- chrome::NOTIFICATION_CONTENT_SETTINGS_CHANGED, |
- Source<HostContentSettingsMap>(host_content_settings_map_), |
- Details<const ContentSettingsDetails>(&details)); |
} |
void PolicyProvider::Observe(int type, |
@@ -466,11 +454,10 @@ void PolicyProvider::Observe(int type, |
*name == prefs::kManagedPopupsAllowedForUrls || |
*name == prefs::kManagedPopupsBlockedForUrls) { |
ReadManagedContentSettings(true); |
- ContentSettingsDetails details(ContentSettingsPattern(), |
- ContentSettingsPattern(), |
- CONTENT_SETTINGS_TYPE_DEFAULT, |
- std::string()); |
- NotifyObservers(details); |
+ NotifyObservers(ContentSettingsPattern(), |
+ ContentSettingsPattern(), |
+ CONTENT_SETTINGS_TYPE_DEFAULT, |
+ std::string()); |
} |
} else { |
NOTREACHED() << "Unexpected notification"; |