OLD | NEW |
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 bool can_show_bubble; | 66 bool can_show_bubble; |
67 }; | 67 }; |
68 | 68 |
69 ~ZoomController() override; | 69 ~ZoomController() override; |
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 | 73 // Convenience method to get default zoom level. Implemented here for |
74 // inlining. | 74 // inlining. |
75 double GetDefaultZoomLevel() const { | 75 double GetDefaultZoomLevel() const { |
76 // TODO(wjmaclean) Make this refer to the webcontents-specific HostZoomMap | 76 return content::HostZoomMap::GetForWebContents(web_contents()) |
77 // when that becomes available. | 77 ->GetDefaultZoomLevel(); |
78 return content::HostZoomMap::GetDefaultForBrowserContext(browser_context_)-> | |
79 GetDefaultZoomLevel(); | |
80 } | 78 } |
81 | 79 |
82 // 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. |
83 bool IsAtDefaultZoom() const; | 81 bool IsAtDefaultZoom() const; |
84 | 82 |
85 // Returns which image should be loaded for the current zoom level. | 83 // Returns which image should be loaded for the current zoom level. |
86 int GetResourceForZoomLevel() const; | 84 int GetResourceForZoomLevel() const; |
87 | 85 |
88 const extensions::Extension* last_extension() const { | 86 const extensions::Extension* last_extension() const { |
89 return last_extension_.get(); | 87 return last_extension_.get(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 ObserverList<ZoomObserver> observers_; | 159 ObserverList<ZoomObserver> observers_; |
162 | 160 |
163 content::BrowserContext* browser_context_; | 161 content::BrowserContext* browser_context_; |
164 | 162 |
165 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 163 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
166 | 164 |
167 DISALLOW_COPY_AND_ASSIGN(ZoomController); | 165 DISALLOW_COPY_AND_ASSIGN(ZoomController); |
168 }; | 166 }; |
169 | 167 |
170 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ | 168 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ |
OLD | NEW |