diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-11 19:34:47 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-11 19:34:47 +0000 |
commit | 9ea9ca45885eeb653d041a7f828ee8880ae4926a (patch) | |
tree | f811d8c7c0417ceac57b6c950d065faea3ab0593 /chrome/browser/cocoa/content_settings_dialog_controller.mm | |
parent | cbc9ed60c4959214cbbcff09035534e29eaed0db (diff) | |
download | chromium_src-9ea9ca45885eeb653d041a7f828ee8880ae4926a.zip chromium_src-9ea9ca45885eeb653d041a7f828ee8880ae4926a.tar.gz chromium_src-9ea9ca45885eeb653d041a7f828ee8880ae4926a.tar.bz2 |
Move all the PrefObserverBridges into namespaces (like is already done with ToolbarController's) so we stop violating the ODR and things start working properly.
BUG=http://crbug.com/37898
TEST=as in bug
Review URL: http://codereview.chromium.org/887002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41306 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.mm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/content_settings_dialog_controller.mm b/chrome/browser/cocoa/content_settings_dialog_controller.mm index 2532a44..2af5616 100644 --- a/chrome/browser/cocoa/content_settings_dialog_controller.mm +++ b/chrome/browser/cocoa/content_settings_dialog_controller.mm @@ -53,6 +53,8 @@ ContentSettingsDialogController* g_instance = nil; @property(assign, nonatomic) NSInteger pluginsEnabledIndex; @end +namespace ContentSettingsDialogControllerInternal { + // A C++ class registered for changes in preferences. class PrefObserverBridge : public NotificationObserver { public: @@ -64,11 +66,12 @@ class PrefObserverBridge : public NotificationObserver { virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - std::wstring* pref_name = Details<std::wstring>(details).ptr(); - if (type == NotificationType::PREF_CHANGED && - *pref_name == prefs::kClearSiteDataOnExit) { - // Update UI. - [controller_ setClearSiteDataOnExit:[controller_ clearSiteDataOnExit]]; + if (type == NotificationType::PREF_CHANGED) { + std::wstring* pref_name = Details<std::wstring>(details).ptr(); + if (*pref_name == prefs::kClearSiteDataOnExit) { + // Update UI. + [controller_ setClearSiteDataOnExit:[controller_ clearSiteDataOnExit]]; + } } } @@ -76,6 +79,7 @@ class PrefObserverBridge : public NotificationObserver { ContentSettingsDialogController* controller_; // weak, owns us }; +} // ContentSettingsDialogControllerInternal @implementation ContentSettingsDialogController @@ -113,9 +117,10 @@ class PrefObserverBridge : public NotificationObserver { if ((self = [super initWithWindowNibPath:nibpath owner:self])) { profile_ = profile; - observer_.reset(new PrefObserverBridge(self)); + observer_.reset( + new ContentSettingsDialogControllerInternal::PrefObserverBridge(self)); clearSiteDataOnExit_.Init(prefs::kClearSiteDataOnExit, - profile->GetPrefs(), NULL); + profile->GetPrefs(), observer_.get()); // We don't need to observe changes in this value. lastSelectedTab_.Init(prefs::kContentSettingsWindowLastTabIndex, |