summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/content_settings_dialog_controller.mm
diff options
context:
space:
mode:
authordanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-22 12:43:14 +0000
committerdanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-22 12:43:14 +0000
commit37d5293518a8657af4d79035f7ef2e8c3a8d6b9a (patch)
tree9897f36b9f09457d3a5fbb002abc4e081e79ae56 /chrome/browser/cocoa/content_settings_dialog_controller.mm
parent37c3dacaa38fddba1c53d9b3f3f0514933d3dd45 (diff)
downloadchromium_src-37d5293518a8657af4d79035f7ef2e8c3a8d6b9a.zip
chromium_src-37d5293518a8657af4d79035f7ef2e8c3a8d6b9a.tar.gz
chromium_src-37d5293518a8657af4d79035f7ef2e8c3a8d6b9a.tar.bz2
Use PrefChangeRegistrar everywhere
BUG=54955 TEST=PrefChangeRegistrarTest.* Review URL: http://codereview.chromium.org/3304015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/content_settings_dialog_controller.mm')
-rw-r--r--chrome/browser/cocoa/content_settings_dialog_controller.mm24
1 files changed, 5 insertions, 19 deletions
diff --git a/chrome/browser/cocoa/content_settings_dialog_controller.mm b/chrome/browser/cocoa/content_settings_dialog_controller.mm
index 0c71fd9..70287cc 100644
--- a/chrome/browser/cocoa/content_settings_dialog_controller.mm
+++ b/chrome/browser/cocoa/content_settings_dialog_controller.mm
@@ -140,11 +140,11 @@ class PrefObserverDisabler {
// Manually observe notifications for preferences that are grouped in
// the HostContentSettingsMap or GeolocationContentSettingsMap.
PrefService* prefs = profile_->GetPrefs();
- prefs->AddPrefObserver(prefs::kBlockThirdPartyCookies, observer_.get());
- prefs->AddPrefObserver(prefs::kBlockNonsandboxedPlugins, observer_.get());
- prefs->AddPrefObserver(prefs::kDefaultContentSettings, observer_.get());
- prefs->AddPrefObserver(prefs::kGeolocationDefaultContentSetting,
- observer_.get());
+ registrar_.Init(prefs);
+ registrar_.Add(prefs::kBlockThirdPartyCookies, observer_.get());
+ registrar_.Add(prefs::kBlockNonsandboxedPlugins, observer_.get());
+ registrar_.Add(prefs::kDefaultContentSettings, observer_.get());
+ registrar_.Add(prefs::kGeolocationDefaultContentSetting, observer_.get());
// We don't need to observe changes in this value.
lastSelectedTab_.Init(prefs::kContentSettingsWindowLastTabIndex,
@@ -153,20 +153,6 @@ class PrefObserverDisabler {
return self;
}
-- (void)dealloc {
- if (profile_) {
- PrefService* prefs = profile_->GetPrefs();
- prefs->RemovePrefObserver(prefs::kBlockThirdPartyCookies, observer_.get());
- prefs->RemovePrefObserver(prefs::kBlockNonsandboxedPlugins,
- observer_.get());
- prefs->RemovePrefObserver(prefs::kDefaultContentSettings, observer_.get());
- prefs->RemovePrefObserver(prefs::kGeolocationDefaultContentSetting,
- observer_.get());
- }
-
- [super dealloc];
-}
-
- (void)closeExceptionsSheet {
NSWindow* attachedSheet = [[self window] attachedSheet];
if (attachedSheet) {