| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // TODO(wjmaclean) Make this refer to the webcontents-specific HostZoomMap |
| 77 // when that becomes available. | 77 // when that becomes available. |
| 78 return content::HostZoomMap::GetDefaultForBrowserContext(browser_context_)-> | 78 return content::HostZoomMap::GetDefaultForBrowserContext(browser_context_)-> |
| 79 GetDefaultZoomLevel(); | 79 GetDefaultZoomLevel(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Returns default zoom percentage of a tab. |
| 83 int GetDefaultZoomPercent() const; |
| 84 |
| 82 // Convenience method to quickly check if the tab's at default zoom. | 85 // Convenience method to quickly check if the tab's at default zoom. |
| 83 bool IsAtDefaultZoom() const; | 86 bool IsAtDefaultZoom() const; |
| 84 | 87 |
| 85 // Returns which image should be loaded for the current zoom level. | 88 // Returns which image should be loaded for the current zoom level. |
| 86 int GetResourceForZoomLevel() const; | 89 int GetResourceForZoomLevel() const; |
| 87 | 90 |
| 88 const extensions::Extension* last_extension() const { | 91 const extensions::Extension* last_extension() const { |
| 89 return last_extension_.get(); | 92 return last_extension_.get(); |
| 90 } | 93 } |
| 91 | 94 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 ObserverList<ZoomObserver> observers_; | 164 ObserverList<ZoomObserver> observers_; |
| 162 | 165 |
| 163 content::BrowserContext* browser_context_; | 166 content::BrowserContext* browser_context_; |
| 164 | 167 |
| 165 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 168 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 166 | 169 |
| 167 DISALLOW_COPY_AND_ASSIGN(ZoomController); | 170 DISALLOW_COPY_AND_ASSIGN(ZoomController); |
| 168 }; | 171 }; |
| 169 | 172 |
| 170 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ | 173 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ |
| OLD | NEW |