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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 11362250: Remove PrefObserver usages, batch 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac build. 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/prefs/prefs_tab_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
index 39f326e4da0b3ffb185cd90730dac2d04c47064a..e3a8763092050da4e77802e22146f474042337ac 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -9,7 +9,6 @@
#include "base/mac/bundle_locations.h"
#include "base/mac/mac_util.h"
#include "base/memory/singleton.h"
-#include "base/prefs/public/pref_observer.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
@@ -107,8 +106,7 @@ namespace ToolbarControllerInternal {
// preferences and upgrade available notifications. Bridges the notification
// back to the ToolbarController.
class NotificationBridge
- : public content::NotificationObserver,
- public PrefObserver {
+ : public content::NotificationObserver {
public:
explicit NotificationBridge(ToolbarController* controller)
: controller_(controller) {
@@ -132,9 +130,7 @@ class NotificationBridge
}
}
- // Overridden from PrefObserver:
- virtual void OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) OVERRIDE {
+ void OnPreferenceChanged(const std::string& pref_name) {
[controller_ prefChanged:pref_name];
}
@@ -280,8 +276,11 @@ class NotificationBridge
notificationBridge_.reset(
new ToolbarControllerInternal::NotificationBridge(self));
PrefService* prefs = profile_->GetPrefs();
- showHomeButton_.Init(prefs::kShowHomeButton, prefs,
- notificationBridge_.get());
+ showHomeButton_.Init(
+ prefs::kShowHomeButton, prefs,
+ base::Bind(
+ &ToolbarControllerInternal::NotificationBridge::OnPreferenceChanged,
+ base::Unretained(notificationBridge_.get())));
[self showOptionalHomeButton];
[self installWrenchMenu];
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/prefs/prefs_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698