| 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 CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ | 6 #define CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // This should only be called on the UI thread. | 141 // This should only be called on the UI thread. |
| 142 virtual void SetZoomLevelForHostAndScheme(const std::string& scheme, | 142 virtual void SetZoomLevelForHostAndScheme(const std::string& scheme, |
| 143 const std::string& host, | 143 const std::string& host, |
| 144 double level) = 0; | 144 double level) = 0; |
| 145 | 145 |
| 146 // Returns whether the view manages its zoom level independently of other | 146 // Returns whether the view manages its zoom level independently of other |
| 147 // views displaying content from the same host. | 147 // views displaying content from the same host. |
| 148 virtual bool UsesTemporaryZoomLevel(int render_process_id, | 148 virtual bool UsesTemporaryZoomLevel(int render_process_id, |
| 149 int render_view_id) const = 0; | 149 int render_view_id) const = 0; |
| 150 | 150 |
| 151 // Sets the temporary zoom level that's only valid for the lifetime of this | 151 // Returns the temporary zoom level that's only valid for the lifetime of |
| 152 // WebContents. | 152 // the given view (i.e. isn't saved and doesn't affect other WebContentses) |
| 153 // if it exists, the default zoom level otherwise. |
| 154 // |
| 155 // This may be called on any thread. |
| 156 virtual double GetTemporaryZoomLevel(int render_process_id, |
| 157 int render_view_id) const = 0; |
| 158 |
| 159 // Sets the temporary zoom level that's only valid for the lifetime of the |
| 160 // given view. |
| 153 // | 161 // |
| 154 // This should only be called on the UI thread. | 162 // This should only be called on the UI thread. |
| 155 virtual void SetTemporaryZoomLevel(int render_process_id, | 163 virtual void SetTemporaryZoomLevel(int render_process_id, |
| 156 int render_view_id, | 164 int render_view_id, |
| 157 double level) = 0; | 165 double level) = 0; |
| 158 | 166 |
| 159 // Clears the temporary zoom level stored for this WebContents. | 167 // Clears the temporary zoom level stored for the given view. |
| 160 // | 168 // |
| 161 // This should only be called on the UI thread. | 169 // This should only be called on the UI thread. |
| 162 virtual void ClearTemporaryZoomLevel(int render_process_id, | 170 virtual void ClearTemporaryZoomLevel(int render_process_id, |
| 163 int render_view_id) = 0; | 171 int render_view_id) = 0; |
| 164 | 172 |
| 165 // Get/Set the default zoom level for pages that don't override it. | 173 // Get/Set the default zoom level for pages that don't override it. |
| 166 virtual double GetDefaultZoomLevel() const = 0; | 174 virtual double GetDefaultZoomLevel() const = 0; |
| 167 virtual void SetDefaultZoomLevel(double level) = 0; | 175 virtual void SetDefaultZoomLevel(double level) = 0; |
| 168 | 176 |
| 169 typedef base::Callback<void(const ZoomLevelChange&)> ZoomLevelChangedCallback; | 177 typedef base::Callback<void(const ZoomLevelChange&)> ZoomLevelChangedCallback; |
| 170 typedef base::CallbackList<void(const ZoomLevelChange&)>::Subscription | 178 typedef base::CallbackList<void(const ZoomLevelChange&)>::Subscription |
| 171 Subscription; | 179 Subscription; |
| 172 // Add and remove zoom level changed callbacks. | 180 // Add and remove zoom level changed callbacks. |
| 173 virtual std::unique_ptr<Subscription> AddZoomLevelChangedCallback( | 181 virtual std::unique_ptr<Subscription> AddZoomLevelChangedCallback( |
| 174 const ZoomLevelChangedCallback& callback) = 0; | 182 const ZoomLevelChangedCallback& callback) = 0; |
| 175 | 183 |
| 176 protected: | 184 protected: |
| 177 virtual ~HostZoomMap() {} | 185 virtual ~HostZoomMap() {} |
| 178 }; | 186 }; |
| 179 | 187 |
| 180 } // namespace content | 188 } // namespace content |
| 181 | 189 |
| 182 #endif // CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ | 190 #endif // CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ |
| OLD | NEW |