Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4833)

Unified Diff: chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
index e5814f863b6d9fcd7c9c99463d4911134d13a87d..1e2f4ce2811b102121ac13fcac388682b3643b8f 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
@@ -4,6 +4,7 @@
#include "base/memory/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
+#include "base/prefs/public/pref_observer.h"
#include "base/string_util.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
@@ -19,7 +20,7 @@
// A BrowserWindowCocoa that goes PONG when
// BOOKMARK_BAR_VISIBILITY_PREF_CHANGED is sent. This is so we can be
// sure we are observing it.
-class BrowserWindowCocoaPong : public BrowserWindowCocoa {
+class BrowserWindowCocoaPong : public BrowserWindowCocoa, public PrefObserver {
public:
BrowserWindowCocoaPong(Browser* browser,
BrowserWindowController* controller)
@@ -28,16 +29,10 @@ class BrowserWindowCocoaPong : public BrowserWindowCocoa {
}
virtual ~BrowserWindowCocoaPong() { }
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- const std::string& pref_name =
- *content::Details<std::string>(details).ptr();
- if (pref_name == prefs::kShowBookmarkBar)
- pong_ = true;
- }
- BrowserWindowCocoa::Observe(type, source, details);
+ virtual void OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) OVERRIDE {
+ if (pref_name == prefs::kShowBookmarkBar)
+ pong_ = true;
}
bool pong_;
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698