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

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: 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/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 9812e5d3cd0b72d02fe56620e2034e3930ab9a5d..0ffc957cd7b897775eada40407674278bf1ee449 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -1574,13 +1574,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();
@@ -1594,6 +1587,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();
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698