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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

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: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 7be5f1006676c7800988794aeae343f3fe494fa6..eecb51a19943301cf1b4ce408876589c3672f2cc 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -42,6 +42,7 @@
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
#include "core/editing/InputMethodController.h"
+#include "core/editing/SelectionController.h"
#include "core/editing/iterators/TextIterator.h"
#include "core/editing/markers/DocumentMarkerController.h"
#include "core/editing/serializers/HTMLInterchange.h"
@@ -2256,6 +2257,22 @@ WebInputEventResult WebViewImpl::handleInputEvent(const WebInputEvent& inputEven
return WebInputEventResult::NotHandled;
}
+bool WebViewImpl::selectWordIfAnyAt(const WebPoint& position)
+{
+ HitTestResult result = hitTestResultForRootFramePos(position);
+ Frame* targetFrame;
+ if (result.innerNodeOrImageMapImage())
+ targetFrame = result.innerNodeOrImageMapImage()->document().frame();
+ else
+ targetFrame = m_page->focusController().focusedOrMainFrame();
+
+ if (!targetFrame->isLocalFrame())
+ return false;
+
+ LocalFrame* localFrame = toLocalFrame(targetFrame);
+ return localFrame->eventHandler().selectionController().selectWordAtPositionIfAny(result);
+}
+
void WebViewImpl::setCursorVisibilityState(bool isVisible)
{
if (m_page)

Powered by Google App Engine
This is Rietveld 408576698