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

Unified Diff: content/browser/host_zoom_map_impl.h

Issue 954923005: Make command-zero reset page scale in addition to zoom level (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again again Created 5 years, 9 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
« no previous file with comments | « components/ui/zoom/zoom_controller.cc ('k') | content/browser/host_zoom_map_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 468bf68b735f47f20706ca76760ef2e6345faee1..a9b2a45d3ef5e3fc0ffc9a38f2341530f82ba7b9 100644
--- a/content/browser/host_zoom_map_impl.h
+++ b/content/browser/host_zoom_map_impl.h
@@ -29,6 +29,10 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap),
~HostZoomMapImpl() override;
// HostZoomMap implementation:
+ void SetPageScaleFactorIsOneForView(
+ int render_process_id, int render_view_id, bool is_one) override;
+ void ClearPageScaleFactorIsOneForView(
+ int render_process_id, int render_view_id) override;
void CopyFrom(HostZoomMap* copy) override;
double GetZoomLevelForHostAndScheme(const std::string& scheme,
const std::string& host) const override;
@@ -58,6 +62,9 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap),
double GetZoomLevelForWebContents(
const WebContentsImpl& web_contents_impl) const;
+ bool PageScaleFactorIsOneForWebContents(
+ const WebContentsImpl& web_contents_impl) const;
+
// Sets the zoom level for this WebContents. If this WebContents is using
// a temporary zoom level, then level is only applied to this WebContents.
// Otherwise, the level will be applied on a host level.
@@ -112,6 +119,7 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap),
};
typedef std::map<RenderViewKey, double> TemporaryZoomLevels;
+ typedef std::map<RenderViewKey, bool> ViewPageScaleFactorsAreOne;
double GetZoomLevelForHost(const std::string& host) const;
@@ -137,12 +145,16 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap),
SchemeHostZoomLevels scheme_host_zoom_levels_;
double default_zoom_level_;
+ // Page scale factor data for each renderer.
+ ViewPageScaleFactorsAreOne view_page_scale_factors_are_one_;
+
// Don't expect more than a couple of tabs that are using a temporary zoom
// level, so vector is fine for now.
TemporaryZoomLevels temporary_zoom_levels_;
- // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and
- // |temporary_zoom_levels_| to guarantee thread safety.
+ // Used around accesses to |host_zoom_levels_|, |default_zoom_level_|,
+ // |temporary_zoom_levels_|, and |view_page_scale_factors_are_one_| to
+ // guarantee thread safety.
mutable base::Lock lock_;
NotificationRegistrar registrar_;
« no previous file with comments | « components/ui/zoom/zoom_controller.cc ('k') | content/browser/host_zoom_map_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698