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

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: 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/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..91a0fcb755549d7a6e9717c44c5c4c7b0c5fc40d 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];
}
@@ -281,7 +277,8 @@ class NotificationBridge
new ToolbarControllerInternal::NotificationBridge(self));
PrefService* prefs = profile_->GetPrefs();
showHomeButton_.Init(prefs::kShowHomeButton, prefs,
- notificationBridge_.get());
+ base::Bind(&NotificationBridge::OnPreferenceChanged,
+ base::Unretained(notificationBridge_.get())));
[self showOptionalHomeButton];
[self installWrenchMenu];

Powered by Google App Engine
This is Rietveld 408576698