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

Side by Side Diff: chrome/browser/ui/zoom/zoom_controller.h

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test compilation. Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 double old_zoom_level; 63 double old_zoom_level;
64 double new_zoom_level; 64 double new_zoom_level;
65 ZoomController::ZoomMode zoom_mode; 65 ZoomController::ZoomMode zoom_mode;
66 bool can_show_bubble; 66 bool can_show_bubble;
67 }; 67 };
68 68
69 virtual ~ZoomController(); 69 virtual ~ZoomController();
70 70
71 ZoomMode zoom_mode() const { return zoom_mode_; } 71 ZoomMode zoom_mode() const { return zoom_mode_; }
72 72
73 // Convenience method to get default zoom level. Implemented here for
74 // inlining.
75 double GetDefaultZoomLevel() const {
76 return content::HostZoomMap::GetForWebContents(web_contents())
77 ->GetDefaultZoomLevel();
78 }
79
73 // Convenience method to quickly check if the tab's at default zoom. 80 // Convenience method to quickly check if the tab's at default zoom.
74 bool IsAtDefaultZoom() const; 81 bool IsAtDefaultZoom() const;
75 82
76 // Returns which image should be loaded for the current zoom level. 83 // Returns which image should be loaded for the current zoom level.
77 int GetResourceForZoomLevel() const; 84 int GetResourceForZoomLevel() const;
78 85
79 const extensions::Extension* last_extension() const { 86 const extensions::Extension* last_extension() const {
80 return last_extension_.get(); 87 return last_extension_.get();
81 } 88 }
82 89
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 142
136 // True if changes to zoom level can trigger the zoom notification bubble. 143 // True if changes to zoom level can trigger the zoom notification bubble.
137 bool can_show_bubble_; 144 bool can_show_bubble_;
138 145
139 // The current zoom mode. 146 // The current zoom mode.
140 ZoomMode zoom_mode_; 147 ZoomMode zoom_mode_;
141 148
142 // Current zoom level. 149 // Current zoom level.
143 double zoom_level_; 150 double zoom_level_;
144 151
145 // Used to access the default zoom level preference. 152 // Used to notify about changes in the default zoom level preference.
146 DoublePrefMember default_zoom_level_; 153 DoublePrefMember default_zoom_level_;
147 154
148 scoped_ptr<ZoomChangedEventData> event_data_; 155 scoped_ptr<ZoomChangedEventData> event_data_;
149 156
150 // Keeps track of the extension (if any) that initiated the last zoom change 157 // Keeps track of the extension (if any) that initiated the last zoom change
151 // that took effect. 158 // that took effect.
152 scoped_refptr<const extensions::Extension> last_extension_; 159 scoped_refptr<const extensions::Extension> last_extension_;
153 160
154 // Observer receiving notifications on state changes. 161 // Observer receiving notifications on state changes.
155 ObserverList<ZoomObserver> observers_; 162 ObserverList<ZoomObserver> observers_;
156 163
157 content::BrowserContext* browser_context_; 164 content::BrowserContext* browser_context_;
158 165
159 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; 166 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_;
160 167
161 DISALLOW_COPY_AND_ASSIGN(ZoomController); 168 DISALLOW_COPY_AND_ASSIGN(ZoomController);
162 }; 169 };
163 170
164 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ 171 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698