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

Unified Diff: chrome/browser/ui/zoom/zoom_controller.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
« no previous file with comments | « chrome/browser/ui/zoom/zoom_controller.h ('k') | chrome/common/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/zoom/zoom_controller.cc
diff --git a/chrome/browser/ui/zoom/zoom_controller.cc b/chrome/browser/ui/zoom/zoom_controller.cc
index a706ae94747f1c6e27d4e2f83da598f93885d0f8..6b0de350b29e627cbc81545a3cd5e2cd61ecdbe6 100644
--- a/chrome/browser/ui/zoom/zoom_controller.cc
+++ b/chrome/browser/ui/zoom/zoom_controller.cc
@@ -65,19 +65,14 @@ void ZoomController::DidNavigateMainFrame(
void ZoomController::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_PREF_CHANGED: {
- std::string* pref_name = content::Details<std::string>(details).ptr();
- DCHECK(pref_name && *pref_name == prefs::kDefaultZoomLevel);
- UpdateState(std::string());
- break;
- }
- case content::NOTIFICATION_ZOOM_LEVEL_CHANGED:
- UpdateState(*content::Details<std::string>(details).ptr());
- break;
- default:
- NOTREACHED();
- }
+ DCHECK_EQ(content::NOTIFICATION_ZOOM_LEVEL_CHANGED, type);
+ UpdateState(*content::Details<std::string>(details).ptr());
+}
+
+void ZoomController::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK(pref_name == prefs::kDefaultZoomLevel);
+ UpdateState(std::string());
}
void ZoomController::UpdateState(const std::string& host) {
« no previous file with comments | « chrome/browser/ui/zoom/zoom_controller.h ('k') | chrome/common/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698