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

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

Issue 2972863003: Introduce CreateVisibleSelectionWithGranularity() (Closed)
Patch Set: 2017-07-06T16:26:15 Created 3 years, 5 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 84d0b6a250ac4356f2843c74919923ae8fd4d178..71cac4286e5890afd3eabfcdb0a4f68f0f0e0ce6 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -535,12 +535,12 @@ bool SelectionController::SelectClosestWordFromHitTestResult(
const VisiblePositionInFlatTree& pos =
VisiblePositionOfHitTestResult(adjusted_hit_test_result);
const VisibleSelectionInFlatTree& new_selection =
- pos.IsNotNull()
- ? CreateVisibleSelection(SelectionInFlatTree::Builder()
- .Collapse(pos.ToPositionWithAffinity())
- .SetGranularity(kWordGranularity)
- .Build())
- : VisibleSelectionInFlatTree();
+ pos.IsNotNull() ? CreateVisibleSelectionWithGranularity(
+ SelectionInFlatTree::Builder()
+ .Collapse(pos.ToPositionWithAffinity())
+ .Build(),
+ kWordGranularity)
+ : VisibleSelectionInFlatTree();
HandleVisibility visibility = HandleVisibility::kNotVisible;
if (select_input_event_type == SelectInputEventType::kTouch) {
@@ -903,12 +903,12 @@ bool SelectionController::HandleTripleClick(
const VisiblePositionInFlatTree& pos =
VisiblePositionOfHitTestResult(event.GetHitTestResult());
const VisibleSelectionInFlatTree new_selection =
- pos.IsNotNull()
- ? CreateVisibleSelection(SelectionInFlatTree::Builder()
- .Collapse(pos.ToPositionWithAffinity())
- .SetGranularity(kParagraphGranularity)
- .Build())
- : VisibleSelectionInFlatTree();
+ pos.IsNotNull() ? CreateVisibleSelectionWithGranularity(
+ SelectionInFlatTree::Builder()
+ .Collapse(pos.ToPositionWithAffinity())
+ .Build(),
+ kParagraphGranularity)
+ : VisibleSelectionInFlatTree();
const bool is_handle_visible =
event.Event().FromTouch() && new_selection.IsRange();
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698