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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // if not applicable to |mode|. | 45 // if not applicable to |mode|. |
46 struct ZoomLevelChange { | 46 struct ZoomLevelChange { |
47 ZoomLevelChangeMode mode; | 47 ZoomLevelChangeMode mode; |
48 std::string host; | 48 std::string host; |
49 std::string scheme; | 49 std::string scheme; |
50 double zoom_level; | 50 double zoom_level; |
51 }; | 51 }; |
52 | 52 |
53 typedef std::vector<ZoomLevelChange> ZoomLevelVector; | 53 typedef std::vector<ZoomLevelChange> ZoomLevelVector; |
54 | 54 |
55 CONTENT_EXPORT static HostZoomMap* GetForBrowserContext( | 55 CONTENT_EXPORT static HostZoomMap* GetDefaultForBrowserContext( |
56 BrowserContext* browser_context); | 56 BrowserContext* browser_context); |
57 | 57 |
58 // Returns the current zoom level for the specified WebContents. May be | 58 // Returns the current zoom level for the specified WebContents. May be |
59 // temporary or host-specific. | 59 // temporary or host-specific. |
60 CONTENT_EXPORT static double GetZoomLevel(const WebContents* web_contents); | 60 CONTENT_EXPORT static double GetZoomLevel(const WebContents* web_contents); |
61 | 61 |
62 // Sets the current zoom level for the specified WebContents. The level may | 62 // Sets the current zoom level for the specified WebContents. The level may |
63 // be temporary or host-specific depending on the particular WebContents. | 63 // be temporary or host-specific depending on the particular WebContents. |
64 CONTENT_EXPORT static void SetZoomLevel(const WebContents* web_contents, | 64 CONTENT_EXPORT static void SetZoomLevel(const WebContents* web_contents, |
65 double level); | 65 double level); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 virtual scoped_ptr<Subscription> AddZoomLevelChangedCallback( | 139 virtual scoped_ptr<Subscription> AddZoomLevelChangedCallback( |
140 const ZoomLevelChangedCallback& callback) = 0; | 140 const ZoomLevelChangedCallback& callback) = 0; |
141 | 141 |
142 protected: | 142 protected: |
143 virtual ~HostZoomMap() {} | 143 virtual ~HostZoomMap() {} |
144 }; | 144 }; |
145 | 145 |
146 } // namespace content | 146 } // namespace content |
147 | 147 |
148 #endif // CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ | 148 #endif // CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ |
OLD | NEW |