Chromium Code Reviews| Index: content/browser/host_zoom_map_impl.h |
| diff --git a/content/browser/host_zoom_map_impl.h b/content/browser/host_zoom_map_impl.h |
| index 155f18e00fb2babd091a352d5df7b2b6974982ce..08a53fd1fcce332afbaeb92984641a423cd3346a 100644 |
| --- a/content/browser/host_zoom_map_impl.h |
| +++ b/content/browser/host_zoom_map_impl.h |
| @@ -30,10 +30,18 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap), |
| // HostZoomMap implementation: |
| virtual void CopyFrom(HostZoomMap* copy) OVERRIDE; |
| + double GetZoomLevelForWebContents( |
| + const WebContents& web_contents) const; |
| virtual double GetZoomLevelForHostAndScheme( |
| const std::string& scheme, |
| const std::string& host) const OVERRIDE; |
| virtual ZoomLevelVector GetAllZoomLevels() const OVERRIDE; |
| + void SetZoomLevelForWebContents(const WebContents& web_contents, |
| + double level); |
| + void SetZoomLevelForView(int render_process_id, |
| + int render_view_id, |
| + double level, |
| + const std::string& host); |
|
jam
2014/05/23 15:51:04
here and above, don't put these methods which aren
wjmaclean
2014/05/23 17:07:09
Ooops, not paying attention here ... will move the
|
| virtual void SetZoomLevelForHost( |
| const std::string& host, |
| double level) OVERRIDE; |
| @@ -46,6 +54,10 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap), |
| virtual scoped_ptr<Subscription> AddZoomLevelChangedCallback( |
| const ZoomLevelChangedCallback& callback) OVERRIDE; |
| + bool UsesTemporaryZoomLevel(int render_process_id, int render_view_id) const; |
| + void SetUsesTemporaryZoomLevel(int render_process_id, |
| + int render_view_id, |
| + bool uses_temporary_zoom_settings); |
|
jam
2014/05/23 15:51:04
nit: document everything. also new line after this
wjmaclean
2014/05/23 17:07:09
Done.
|
| // Returns the temporary zoom level that's only valid for the lifetime of |
| // the given WebContents (i.e. isn't saved and doesn't affect other |
| // WebContentses) if it exists, the default zoom level otherwise. |
| @@ -86,11 +98,27 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap), |
| int render_process_id; |
| int render_view_id; |
| double zoom_level; |
| + |
| + TemporaryZoomLevel(int process_id, int view_id, double level) |
| + : render_process_id(process_id), |
| + render_view_id(view_id), |
| + zoom_level(level) {} |
| + |
| + TemporaryZoomLevel(int process_id, int view_id) |
| + : render_process_id(process_id), |
| + render_view_id(view_id), |
| + zoom_level(0.0) {} |
| + |
| + bool operator==(const TemporaryZoomLevel& other) const { |
| + return other.render_process_id == render_process_id && |
| + other.render_view_id == render_view_id; |
| + } |
| }; |
| // Don't expect more than a couple of tabs that are using a temporary zoom |
| // level, so vector is fine for now. |
| - std::vector<TemporaryZoomLevel> temporary_zoom_levels_; |
| + typedef std::vector<TemporaryZoomLevel> TemporaryZoomLevelList; |
| + TemporaryZoomLevelList temporary_zoom_levels_; |
| // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and |
| // |temporary_zoom_levels_| to guarantee thread safety. |