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_emulation_helper_) |
+ device_emulation_helper_->PopupCreated(this, widget); |
return widget->webwidget(); |
} |
@@ -2455,6 +2457,23 @@ |
plugin->initializeFrame(main_render_frame_.get()); |
} |
+void RenderViewImpl::emulateDevice( |
+ bool enabled, |
+ const WebKit::WebSize& device_size, |
+ const WebKit::WebRect& view_rect, |
+ float device_scale_factor, |
+ bool fit_to_view) { |
+ if (enabled && webview()) |
+ webview()->settings()->setForceCompositingMode(true); |
+ EmulateDevice(enabled, gfx::Size(device_size), gfx::Rect(view_rect), |
+ device_scale_factor, fit_to_view); |
+} |
+ |
+void RenderViewImpl::SetDeviceEmulationScale(float scale) { |
+ if (webview() && webview()->devToolsAgent()) |
+ webview()->devToolsAgent()->setDeviceEmulationScale(scale); |
+} |
+ |
void RenderViewImpl::didStartLoading() { |
if (is_loading_) { |
DVLOG(1) << "didStartLoading called while loading"; |
@@ -2655,6 +2674,8 @@ |
params.x = touch_editing_context_menu_location_.x(); |
params.y = touch_editing_context_menu_location_.y(); |
} |
+ if (device_emulation_helper_) |
+ device_emulation_helper_->OnShowContextMenu(this, ¶ms); |
// 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 |