Chromium Code Reviews| Index: Source/web/WebLocalFrameImpl.cpp |
| diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp |
| index c508c7f825670dc38d164d6192373edcbba25fd8..6c7b6050fc5d04724991d02081c9abe49a8080aa 100644 |
| --- a/Source/web/WebLocalFrameImpl.cpp |
| +++ b/Source/web/WebLocalFrameImpl.cpp |
| @@ -1162,6 +1162,22 @@ void WebLocalFrameImpl::selectRange(const WebRange& webRange) |
| frame()->selection().setSelectedRange(range.get(), VP_DEFAULT_AFFINITY, FrameSelection::NonDirectional, NotUserTriggered); |
| } |
| +void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& point) |
| +{ |
| + VisibleSelection currentSelection = frame()->selection().selection(); |
| + |
| + VisiblePosition basePosition = currentSelection.isBaseFirst() ? |
| + currentSelection.visibleStart() : currentSelection.visibleEnd(); |
| + VisiblePosition extentPosition = visiblePositionForWindowPoint(point); |
| + |
| + // Prevent the selection from collapsing. |
|
mlamouri (slow - plz ping)
2014/10/18 08:43:52
nit: could that be expressed in the WebLocalFrame.
|
| + if (comparePositions(basePosition, extentPosition) == 0) |
| + return; |
| + |
| + VisibleSelection newSelection = VisibleSelection(basePosition, extentPosition); |
| + frame()->selection().setSelection(newSelection, CharacterGranularity); |
| +} |
| + |
| void WebLocalFrameImpl::moveRangeSelection(const WebPoint& base, const WebPoint& extent) |
| { |
| VisiblePosition basePosition = visiblePositionForWindowPoint(base); |