| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Returns the zoom level for the host or spec for a given url. The zoom | 32 // Returns the zoom level for the host or spec for a given url. The zoom |
| 33 // level is determined by the host portion of the URL, or (in the absence of | 33 // level is determined by the host portion of the URL, or (in the absence of |
| 34 // a host) the complete spec of the URL. In most cases, there is no custom | 34 // a host) the complete spec of the URL. In most cases, there is no custom |
| 35 // zoom level, and this returns the user's default zoom level. Otherwise, | 35 // zoom level, and this returns the user's default zoom level. Otherwise, |
| 36 // returns the saved zoom level, which may be positive (to zoom in) or | 36 // returns the saved zoom level, which may be positive (to zoom in) or |
| 37 // negative (to zoom out). | 37 // negative (to zoom out). |
| 38 // | 38 // |
| 39 // This may be called on any thread. | 39 // This may be called on any thread. |
| 40 virtual double GetZoomLevel(const std::string& host) const = 0; | 40 virtual double GetZoomLevel(const std::string& host) const = 0; |
| 41 | 41 |
| 42 // Returns the zoom level for the host or spec for a given url, taking |
| 43 // |scheme| in account. If there is specific zoom level specified for given |
| 44 // |scheme| and |host| pair, it will be returned. In other cases result is |
| 45 // equivalent to GetZoomLevel(host). |
| 46 // |
| 47 // This may be called on any thread. |
| 48 virtual double GetZoomLevel(const std::string& scheme, |
| 49 const std::string& host) const = 0; |
| 50 |
| 42 // Sets the zoom level for the host or spec for a given url to |level|. If | 51 // Sets the zoom level for the host or spec for a given url to |level|. If |
| 43 // the level matches the current default zoom level, the host is erased | 52 // the level matches the current default zoom level, the host is erased |
| 44 // from the saved preferences; otherwise the new value is written out. | 53 // from the saved preferences; otherwise the new value is written out. |
| 45 // | 54 // |
| 46 // This should only be called on the UI thread. | 55 // This should only be called on the UI thread. |
| 47 virtual void SetZoomLevel(const std::string& host, double level) = 0; | 56 virtual void SetZoomLevel(const std::string& host, double level) = 0; |
| 48 | 57 |
| 58 // Sets the zoom level for the |scheme|/|host| pair to |level|. |
| 59 // |
| 60 // This should only be called on the UI thread. |
| 61 virtual void SetZoomLevel(const std::string& scheme, |
| 62 const std::string& host, |
| 63 double level) = 0; |
| 64 |
| 49 // Get/Set the default zoom level for pages that don't override it. | 65 // Get/Set the default zoom level for pages that don't override it. |
| 50 virtual double GetDefaultZoomLevel() const = 0; | 66 virtual double GetDefaultZoomLevel() const = 0; |
| 51 virtual void SetDefaultZoomLevel(double level) = 0;; | 67 virtual void SetDefaultZoomLevel(double level) = 0;; |
| 52 | 68 |
| 53 protected: | 69 protected: |
| 54 virtual ~HostZoomMap() {} | 70 virtual ~HostZoomMap() {} |
| 55 }; | 71 }; |
| 56 | 72 |
| 57 } // namespace content | 73 } // namespace content |
| 58 | 74 |
| 59 #endif // CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ | 75 #endif // CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ |
| OLD | NEW |