Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(911)

Unified Diff: content/browser/host_zoom_map_impl.h

Issue 287093002: Remove ViewMsg_SetZoomLevel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update temporary zoom settings in OnDocumentAvailableInMainFrame Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698