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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 2 months 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/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index fc4665c51bd08c30bd124cfb6d9ccf9337962cfd..d8dd138f6ec9e346cdba6fe1e1ad22c0d513cfbc 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -1576,13 +1576,6 @@ void LocationBarView::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_PREF_CHANGED: {
- std::string* name = content::Details<std::string>(details).ptr();
- if (*name == prefs::kEditBookmarksEnabled)
- Update(NULL);
- break;
- }
-
case chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED: {
// Only update if the updated action box was for the active tab contents.
WebContents* target_tab = content::Details<WebContents>(details).ptr();
@@ -1596,6 +1589,12 @@ void LocationBarView::Observe(int type,
}
}
+void LocationBarView::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ if (pref_name == prefs::kEditBookmarksEnabled)
+ Update(NULL);
+}
+
int LocationBarView::GetInternalHeight(bool use_preferred_size) {
int total_height =
use_preferred_size ? GetPreferredSize().height() : height();

Powered by Google App Engine
This is Rietveld 408576698