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

Unified Diff: content/renderer/render_widget.cc

Issue 2894043002: Add machinery to show touch editing context menus in OOPIFs. (Closed)
Patch Set: Don't fall back to mainframe, formatting. Created 3 years, 7 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_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,

Powered by Google App Engine
This is Rietveld 408576698