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

Unified Diff: content/renderer/render_view_impl.cc

Issue 1528153004: Look Up on Force Touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 00c278e9debd13901b9162cceacf0ac203057a2b..5c1ee15e70d17a1882ad4567b6b3b8e293f4749a 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1395,6 +1395,7 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize)
IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility)
IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged)
+ IPC_MESSAGE_HANDLER(InputMsg_SelectWordIfAnyAt, OnSelectWordIfAnyAt)
#endif
// Adding a new message? Add platform independent ones first, then put the
// platform specific ones at the end.
@@ -3010,6 +3011,18 @@ void RenderViewImpl::OnWindowFrameChanged(const gfx::Rect& window_frame,
#endif
}
+void RenderViewImpl::OnSelectWordIfAnyAt(const WebPoint& position) {
+ input_handler_.set_handling_input_event(true);
+ if (!webview())
+ return;
+
+ // Send a response if a word has been selected.
+ if (webview()->selectWordIfAnyAt(position))
+ Send(new InputHostMsg_DidSelectWordAt(routing_id()));
+ input_handler_.set_handling_input_event(false);
+}
+
+
void RenderViewImpl::OnPluginImeCompositionCompleted(const base::string16& text,
int plugin_id) {
// WebPluginDelegateProxy is responsible for figuring out if this event

Powered by Google App Engine
This is Rietveld 408576698