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

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

Issue 23364004: Implementation of device metrics emulation in render view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 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_widget_host_impl.cc
===================================================================
--- content/browser/renderer_host/render_widget_host_impl.cc (revision 217537)
+++ content/browser/renderer_host/render_widget_host_impl.cc (working copy)
@@ -430,6 +430,7 @@
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_EmulateDevice, OnEmulateDevice)
IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur)
IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
@@ -1668,6 +1669,12 @@
smooth_scroll_gesture_controller_.BeginSmoothScroll(view_, params);
}
+void RenderWidgetHostImpl::OnEmulateDevice(bool enabled) {
+ if (view_)
+ view_->EmulateDevice(enabled);
+ Send(new ViewMsg_EmulateDevice_ACK(routing_id_, enabled));
+}
+
void RenderWidgetHostImpl::OnFocus() {
// Only RenderViewHost can deal with that message.
RecordAction(UserMetricsAction("BadMessageTerminate_RWH4"));

Powered by Google App Engine
This is Rietveld 408576698