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

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 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/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 60f179a96509fb54c23b1de1396f1530119f9c9c..26eae876de6fd3eaae14f6ed8bc195eb58c2cae8 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -542,6 +542,18 @@ bool SelectionController::handleMouseReleaseEvent(const MouseEventWithHitTestRes
return handleMouseReleaseEventAlgorithm<EditingStrategy>(event, dragStartPos);
}
+bool SelectionController::selectWordAtPositionIfAny(const HitTestResult& result)
+{
+ 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