| 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 COMPONENTS_ZOOM_ZOOM_CONTROLLER_H_ | 5 #ifndef COMPONENTS_ZOOM_ZOOM_CONTROLLER_H_ |
| 6 #define COMPONENTS_ZOOM_ZOOM_CONTROLLER_H_ | 6 #define COMPONENTS_ZOOM_ZOOM_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 ZoomMode zoom_mode() const { return zoom_mode_; } | 98 ZoomMode zoom_mode() const { return zoom_mode_; } |
| 99 | 99 |
| 100 // Convenience method to get default zoom level. Implemented here for | 100 // Convenience method to get default zoom level. Implemented here for |
| 101 // inlining. | 101 // inlining. |
| 102 double GetDefaultZoomLevel() const { | 102 double GetDefaultZoomLevel() const { |
| 103 return content::HostZoomMap::GetForWebContents(web_contents()) | 103 return content::HostZoomMap::GetForWebContents(web_contents()) |
| 104 ->GetDefaultZoomLevel(); | 104 ->GetDefaultZoomLevel(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Convenience method to quickly check if the tab's at default zoom. | 107 // Convenience method to quickly check if the tab's at default zoom. |
| 108 bool IsAtDefaultZoom() const; | 108 // Virtual for testing. |
| 109 virtual bool IsAtDefaultZoom() const; |
| 109 | 110 |
| 110 // Returns which image should be loaded for the current zoom level. | 111 // Returns which image should be loaded for the current zoom level. |
| 111 RelativeZoom GetZoomRelativeToDefault() const; | 112 RelativeZoom GetZoomRelativeToDefault() const; |
| 112 | 113 |
| 113 const ZoomRequestClient* last_client() const { return last_client_.get(); } | 114 const ZoomRequestClient* last_client() const { return last_client_.get(); } |
| 114 | 115 |
| 115 void AddObserver(ZoomObserver* observer); | 116 void AddObserver(ZoomObserver* observer); |
| 116 void RemoveObserver(ZoomObserver* observer); | 117 void RemoveObserver(ZoomObserver* observer); |
| 117 | 118 |
| 118 // Used to set whether the zoom notification bubble can be shown when the | 119 // Used to set whether the zoom notification bubble can be shown when the |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 content::HostZoomMap* host_zoom_map_; | 196 content::HostZoomMap* host_zoom_map_; |
| 196 | 197 |
| 197 std::unique_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 198 std::unique_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 198 | 199 |
| 199 DISALLOW_COPY_AND_ASSIGN(ZoomController); | 200 DISALLOW_COPY_AND_ASSIGN(ZoomController); |
| 200 }; | 201 }; |
| 201 | 202 |
| 202 } // namespace zoom | 203 } // namespace zoom |
| 203 | 204 |
| 204 #endif // COMPONENTS_ZOOM_ZOOM_CONTROLLER_H_ | 205 #endif // COMPONENTS_ZOOM_ZOOM_CONTROLLER_H_ |
| OLD | NEW |