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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1408393003: Propagate pageScaleFactor to GuestViews (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2e9e6d9e1622487022ead2c89b2be2086afeb901..b83951e0979c0b3cd0ebd039c20f7db0dea77a72 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -637,6 +637,8 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
OnDidRunInsecureContent)
IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged,
+ OnPageScaleFactorChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory)
IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler,
OnRegisterProtocolHandler)
@@ -2622,6 +2624,10 @@ int WebContentsImpl::GetMaximumZoomPercent() const {
return maximum_zoom_percent_;
}
+void WebContentsImpl::SetPageScale(float page_scale_factor) {
+ Send(new ViewMsg_SetPageScale(GetRoutingID(), page_scale_factor));
+}
+
void WebContentsImpl::ResetPageScale() {
Send(new ViewMsg_ResetPageScale(GetRoutingID()));
}
@@ -3120,6 +3126,12 @@ void WebContentsImpl::OnUpdateZoomLimits(int minimum_percent,
maximum_zoom_percent_ = maximum_percent;
}
+void WebContentsImpl::OnPageScaleFactorChanged(float page_scale_factor) {
+ FOR_EACH_OBSERVER(WebContentsObserver,
+ observers_,
+ OnPageScaleFactorChanged(page_scale_factor));
+}
+
void WebContentsImpl::OnEnumerateDirectory(int request_id,
const base::FilePath& path) {
if (!delegate_)

Powered by Google App Engine
This is Rietveld 408576698