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

Unified Diff: third_party/WebKit/Source/core/page/TouchAdjustment.cpp

Issue 2916493002: Make SelectionState enum class (Closed)
Patch Set: Created 3 years, 7 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/page/TouchAdjustment.cpp
diff --git a/third_party/WebKit/Source/core/page/TouchAdjustment.cpp b/third_party/WebKit/Source/core/page/TouchAdjustment.cpp
index d501319d1ed1cd8bb5d6a0a25c302780c13e977c..d3656cc35f63390da3fe97e0b90a672be0a949f9 100644
--- a/third_party/WebKit/Source/core/page/TouchAdjustment.cpp
+++ b/third_party/WebKit/Source/core/page/TouchAdjustment.cpp
@@ -140,7 +140,7 @@ bool ProvidesContextMenuItems(Node* node) {
return true;
// Only the selected part of the layoutObject is a valid target, but this
// will be corrected in appendContextSubtargetsForNode.
- if (node->GetLayoutObject()->GetSelectionState() != SelectionNone)
+ if (node->GetLayoutObject()->GetSelectionState() != SelectionState::kNone)
return true;
}
return false;
@@ -202,24 +202,24 @@ static inline void AppendContextSubtargetsForNode(
last_offset = offset;
}
} else {
- if (text_layout_object->GetSelectionState() == SelectionNone)
+ if (text_layout_object->GetSelectionState() == SelectionState::kNone)
return AppendBasicSubtargetsForNode(node, subtargets);
// If selected, make subtargets out of only the selected part of the text.
int start_pos, end_pos;
switch (text_layout_object->GetSelectionState()) {
- case SelectionInside:
+ case SelectionState::kInside:
start_pos = 0;
end_pos = text_layout_object->TextLength();
break;
- case SelectionStart:
+ case SelectionState::kStart:
std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd();
end_pos = text_layout_object->TextLength();
break;
- case SelectionEnd:
+ case SelectionState::kEnd:
std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd();
start_pos = 0;
break;
- case SelectionBoth:
+ case SelectionState::kStartAndEnd:
std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd();
break;
default:
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp ('k') | third_party/WebKit/Source/core/paint/BoxClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698