Index: content/renderer/render_widget.cc |
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
index dd984d51f973cfd4a1edb48a4b3539efa1540b06..abd7b2e2a212c5a4a19fec6699259d59efd22081 100644 |
--- a/content/renderer/render_widget.cc |
+++ b/content/renderer/render_widget.cc |
@@ -615,6 +615,7 @@ bool RenderWidget::OnMessageReceived(const IPC::Message& message) { |
IPC_MESSAGE_HANDLER(InputMsg_SetFocus, OnSetFocus) |
IPC_MESSAGE_HANDLER(InputMsg_SyntheticGestureCompleted, |
OnSyntheticGestureCompleted) |
+ IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu) |
IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose) |
IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize) |
IPC_MESSAGE_HANDLER(ViewMsg_EnableDeviceEmulation, |
@@ -1586,6 +1587,18 @@ void RenderWidget::SetPendingWindowRect(const WebRect& rect) { |
} |
} |
+void RenderWidget::OnShowContextMenu(ui::MenuSourceType source_type, |
+ const gfx::Point& location) { |
+ input_handler_->set_context_menu_source_type(source_type); |
+ has_host_context_menu_location_ = true; |
+ host_context_menu_location_ = location; |
+ if (GetWebWidget()) { |
+ GetWebWidget()->ShowContextMenu( |
+ static_cast<blink::WebMenuSourceType>(source_type)); |
+ } |
+ has_host_context_menu_location_ = false; |
+} |
+ |
void RenderWidget::OnImeSetComposition( |
const base::string16& text, |
const std::vector<WebCompositionUnderline>& underlines, |