| 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_BROWSER_HOST_ZOOM_MAP_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ |
| 6 #define CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ | 6 #define CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // TODO(wjmaclean) Should we use a GURL here? crbug.com/384486 | 41 // TODO(wjmaclean) Should we use a GURL here? crbug.com/384486 |
| 42 bool HasZoomLevel(const std::string& scheme, | 42 bool HasZoomLevel(const std::string& scheme, |
| 43 const std::string& host) const override; | 43 const std::string& host) const override; |
| 44 ZoomLevelVector GetAllZoomLevels() const override; | 44 ZoomLevelVector GetAllZoomLevels() const override; |
| 45 void SetZoomLevelForHost(const std::string& host, double level) override; | 45 void SetZoomLevelForHost(const std::string& host, double level) override; |
| 46 void SetZoomLevelForHostAndScheme(const std::string& scheme, | 46 void SetZoomLevelForHostAndScheme(const std::string& scheme, |
| 47 const std::string& host, | 47 const std::string& host, |
| 48 double level) override; | 48 double level) override; |
| 49 bool UsesTemporaryZoomLevel(int render_process_id, | 49 bool UsesTemporaryZoomLevel(int render_process_id, |
| 50 int render_view_id) const override; | 50 int render_view_id) const override; |
| 51 double GetTemporaryZoomLevel(int render_process_id, |
| 52 int render_view_id) const override; |
| 51 void SetTemporaryZoomLevel(int render_process_id, | 53 void SetTemporaryZoomLevel(int render_process_id, |
| 52 int render_view_id, | 54 int render_view_id, |
| 53 double level) override; | 55 double level) override; |
| 54 | 56 |
| 55 void ClearTemporaryZoomLevel(int render_process_id, | 57 void ClearTemporaryZoomLevel(int render_process_id, |
| 56 int render_view_id) override; | 58 int render_view_id) override; |
| 57 double GetDefaultZoomLevel() const override; | 59 double GetDefaultZoomLevel() const override; |
| 58 void SetDefaultZoomLevel(double level) override; | 60 void SetDefaultZoomLevel(double level) override; |
| 59 std::unique_ptr<Subscription> AddZoomLevelChangedCallback( | 61 std::unique_ptr<Subscription> AddZoomLevelChangedCallback( |
| 60 const ZoomLevelChangedCallback& callback) override; | 62 const ZoomLevelChangedCallback& callback) override; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 73 void SetZoomLevelForWebContents(const WebContentsImpl& web_contents_impl, | 75 void SetZoomLevelForWebContents(const WebContentsImpl& web_contents_impl, |
| 74 double level); | 76 double level); |
| 75 | 77 |
| 76 // Sets the zoom level for the specified view. The level may be set for only | 78 // Sets the zoom level for the specified view. The level may be set for only |
| 77 // this view, or for the host, depending on UsesTemporaryZoomLevel(). | 79 // this view, or for the host, depending on UsesTemporaryZoomLevel(). |
| 78 void SetZoomLevelForView(int render_process_id, | 80 void SetZoomLevelForView(int render_process_id, |
| 79 int render_view_id, | 81 int render_view_id, |
| 80 double level, | 82 double level, |
| 81 const std::string& host); | 83 const std::string& host); |
| 82 | 84 |
| 83 // Returns the temporary zoom level that's only valid for the lifetime of | |
| 84 // the given WebContents (i.e. isn't saved and doesn't affect other | |
| 85 // WebContentses) if it exists, the default zoom level otherwise. | |
| 86 // | |
| 87 // This may be called on any thread. | |
| 88 double GetTemporaryZoomLevel(int render_process_id, | |
| 89 int render_view_id) const; | |
| 90 | |
| 91 // Returns the zoom level regardless of whether it's temporary, host-keyed or | 85 // Returns the zoom level regardless of whether it's temporary, host-keyed or |
| 92 // scheme+host-keyed. | 86 // scheme+host-keyed. |
| 93 // | 87 // |
| 94 // This may be called on any thread. | 88 // This may be called on any thread. |
| 95 double GetZoomLevelForView(const GURL& url, | 89 double GetZoomLevelForView(const GURL& url, |
| 96 int render_process_id, | 90 int render_process_id, |
| 97 int render_view_id) const; | 91 int render_view_id) const; |
| 98 | 92 |
| 99 // NotificationObserver implementation. | 93 // NotificationObserver implementation. |
| 100 void Observe(int type, | 94 void Observe(int type, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 mutable base::Lock lock_; | 151 mutable base::Lock lock_; |
| 158 | 152 |
| 159 NotificationRegistrar registrar_; | 153 NotificationRegistrar registrar_; |
| 160 | 154 |
| 161 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); | 155 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); |
| 162 }; | 156 }; |
| 163 | 157 |
| 164 } // namespace content | 158 } // namespace content |
| 165 | 159 |
| 166 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ | 160 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ |
| OLD | NEW |