| 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..318fa8bc1c20466027f30ca04860ef51dfdde728 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,18 +29,13 @@ 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_;
|
| };
|
|
|
|
|