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

Unified Diff: chrome/browser/ui/zoom/zoom_controller.h

Issue 12039058: content: convert zoom notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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
« no previous file with comments | « chrome/browser/ui/views/wrench_menu.cc ('k') | chrome/browser/ui/zoom/zoom_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/zoom/zoom_controller.h
diff --git a/chrome/browser/ui/zoom/zoom_controller.h b/chrome/browser/ui/zoom/zoom_controller.h
index 1dd7809c84c59acb7ebbfbf7f5bb0bf95d1ff318..2dda110d2df2277577eb48c78d882ba1cb175996 100644
--- a/chrome/browser/ui/zoom/zoom_controller.h
+++ b/chrome/browser/ui/zoom/zoom_controller.h
@@ -8,8 +8,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/prefs/public/pref_member.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -20,8 +19,7 @@ class WebContents;
}
// Per-tab class to manage the Omnibox zoom icon.
-class ZoomController : public content::NotificationObserver,
- public content::WebContentsObserver,
+class ZoomController : public content::WebContentsObserver,
public content::WebContentsUserData<ZoomController> {
public:
virtual ~ZoomController();
@@ -41,16 +39,13 @@ class ZoomController : public content::NotificationObserver,
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) OVERRIDE;
- // content::NotificationObserver overrides:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
private:
explicit ZoomController(content::WebContents* web_contents);
friend class content::WebContentsUserData<ZoomController>;
friend class ZoomControllerTest;
+ void OnZoomLevelChanged(const std::string& host);
+
// Updates the zoom icon and zoom percentage based on current values and
// notifies the observer if changes have occurred. |host| may be empty,
// meaning the change should apply to ~all sites. If it is not empty, the
@@ -60,14 +55,16 @@ class ZoomController : public content::NotificationObserver,
// The current zoom percentage.
int zoom_percent_;
- content::NotificationRegistrar registrar_;
-
// Used to access the default zoom level preference.
DoublePrefMember default_zoom_level_;
// Observer receiving notifications on state changes.
ZoomObserver* observer_;
+ content::BrowserContext* browser_context_;
+
+ content::HostZoomMap::ZoomLevelChangedCallback zoom_callback_;
+
DISALLOW_COPY_AND_ASSIGN(ZoomController);
};
« no previous file with comments | « chrome/browser/ui/views/wrench_menu.cc ('k') | chrome/browser/ui/zoom/zoom_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698