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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

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
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 4b8b1c22cb687cd446f22fddb6db3bdb214419eb..c9083b4bd5ca92f00f85d4a185b4bb1c128bfdfc 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -873,6 +873,8 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorIsOneChanged,
+ OnPageScaleFactorIsOneChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser)
IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched)
// Have the super handle all other messages.
@@ -1348,6 +1350,19 @@ void RenderViewHostImpl::OnDidZoomURL(double zoom_level,
net::GetHostOrSpecFromURL(url));
}
+void RenderViewHostImpl::OnPageScaleFactorIsOneChanged(bool is_one) {
+ if (!GetSiteInstance())
+ return;
+ HostZoomMapImpl* host_zoom_map =
+ static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
+ if (!host_zoom_map)
+ return;
+ if (!GetProcess())
+ return;
+ host_zoom_map->SetPageScaleFactorIsOneForView(GetProcess()->GetID(),
+ GetRoutingID(), is_one);
+}
+
void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
// Do not allow messages with absolute paths in them as this can permit a
// renderer to coerce the browser to perform I/O on a renderer controlled
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698