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

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

Issue 10959054: Switch ZoomTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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/location_bar/zoom_bubble_view.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 f3d8415cf1e86246261fbce0ad5b2b67cc560e9e..1431763b65862799749870d6d4347204013aa930 100644
--- a/chrome/browser/ui/zoom/zoom_controller.h
+++ b/chrome/browser/ui/zoom/zoom_controller.h
@@ -8,18 +8,22 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/api/prefs/pref_member.h"
+#include "chrome/browser/tab_contents/web_contents_user_data.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
-class TabContents;
class ZoomObserver;
+namespace content {
+class WebContents;
+}
+
// Per-tab class to manage the Omnibox zoom icon.
class ZoomController : public content::NotificationObserver,
- public content::WebContentsObserver {
+ public content::WebContentsObserver,
+ public WebContentsUserData<ZoomController> {
public:
- explicit ZoomController(TabContents* tab_contents);
virtual ~ZoomController();
int zoom_percent() const { return zoom_percent_; }
@@ -33,6 +37,10 @@ class ZoomController : public content::NotificationObserver,
void set_observer(ZoomObserver* observer) { observer_ = observer; }
private:
+ explicit ZoomController(content::WebContents* web_contents);
+ static int kUserDataKey;
+ friend class WebContentsUserData<ZoomController>;
+
// content::WebContentsObserver overrides:
virtual void DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
@@ -59,9 +67,6 @@ class ZoomController : public content::NotificationObserver,
// Used to access the default zoom level preference.
DoublePrefMember default_zoom_level_;
- // TabContents that owns this instance.
- TabContents* tab_contents_;
-
// Observer receiving notifications on state changes.
ZoomObserver* observer_;
« no previous file with comments | « chrome/browser/ui/views/location_bar/zoom_bubble_view.cc ('k') | chrome/browser/ui/zoom/zoom_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698