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

Unified Diff: content/renderer/render_view_impl.cc

Issue 23364004: Implementation of device metrics emulation in render view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Moved helper class to cc 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/renderer/render_view_impl.cc
===================================================================
--- content/renderer/render_view_impl.cc (revision 221161)
+++ content/renderer/render_view_impl.cc (working copy)
@@ -2361,6 +2361,8 @@
WebWidget* RenderViewImpl::createPopupMenu(WebKit::WebPopupType popup_type) {
RenderWidget* widget =
RenderWidget::Create(routing_id_, popup_type, screen_info_);
+ if (device_emulator_)
+ widget->set_popup_device_emulator(device_emulator_.get());
aelias_OOO_until_Jul13 2013/09/20 07:10:14 This weak pointer is sketchy. The popup didn't ne
dgozman 2013/09/27 19:02:03 I don't really want to move this logic to Blink, e
return widget->webwidget();
}
@@ -2655,6 +2657,7 @@
params.x = touch_editing_context_menu_location_.x();
params.y = touch_editing_context_menu_location_.y();
}
+ OnShowHostContextMenu(&params);
// Plugins, e.g. PDF, don't currently update the render view when their
// selected text changes, but the context menu params do contain the updated
@@ -6100,6 +6103,14 @@
return allow_partial_swap_;
}
+void RenderViewImpl::SetDeviceEmulationParameters(
+ bool enabled, float device_scale_factor, float root_layer_scale) {
+ if (webview()) {
+ webview()->setDeviceEmulationParameters(
+ enabled, device_scale_factor, root_layer_scale);
+ }
+}
+
bool RenderViewImpl::ScheduleFileChooser(
const FileChooserParams& params,
WebFileChooserCompletion* completion) {

Powered by Google App Engine
This is Rietveld 408576698