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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 1528153004: Look Up on Force Touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/core/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index 4f74bd149e559af1c3bac79731c5106b7ee23395..ef214d9c63bbbea59cc36bbd7263faad3a0a8901 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -543,6 +543,22 @@ bool SelectionController::handleMouseReleaseEvent(const MouseEventWithHitTestRes
return handleMouseReleaseEventAlgorithm<EditingStrategy>(event, dragStartPos);
}
+bool SelectionController::selectWordAtPositionIfAny(const IntPoint& position)
+{
+ HitTestRequest request(HitTestRequest::Active);
+ HitTestResult result(request, position);
+ m_frame->document()->layoutView()->hitTest(result);
Rick Byers 2015/12/21 16:31:08 You just did a hit-test up in WebViewImpl, it's a
spqchan 2016/01/06 22:52:31 Done.
+
+ if (result.scrollbar()
+ || result.isLiveLink()
+ || !(selection().isContentEditable()
+ || (result.innerNode() && result.innerNode()->isTextNode())))
+ return false;
+
+ selectClosestWordFromHitTestResult<EditingStrategy>(result, AppendTrailingWhitespace::DontAppend);
+ return true;
+}
+
bool SelectionController::handlePasteGlobalSelection(const PlatformMouseEvent& mouseEvent)
{
// If the event was a middle click, attempt to copy global selection in after

Powered by Google App Engine
This is Rietveld 408576698