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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleSelection.h

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/VisibleSelection.h
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.h b/third_party/WebKit/Source/core/editing/VisibleSelection.h
index d3c694bf21f9c8bf2c23c64623cc3a2c3b1c160d..665889c6fe0e52b8d44e01ab573aad8b52c7d50d 100644
--- a/third_party/WebKit/Source/core/editing/VisibleSelection.h
+++ b/third_party/WebKit/Source/core/editing/VisibleSelection.h
@@ -61,6 +61,12 @@ class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate {
// Note: |create()| should be used only by |createVisibleSelection|.
static VisibleSelectionTemplate Create(const SelectionTemplate<Strategy>&);
+ // Note: |CreateWithGranularity()| should be used only by
+ // |CreateVisibleSelectionWithGranularity()|.
+ static VisibleSelectionTemplate CreateWithGranularity(
+ const SelectionTemplate<Strategy>&,
+ TextGranularity);
+
SelectionType GetSelectionType() const { return selection_type_; }
TextAffinity Affinity() const { return affinity_; }
@@ -144,7 +150,7 @@ class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate {
private:
friend class SelectionAdjuster;
- VisibleSelectionTemplate(const SelectionTemplate<Strategy>&);
+ VisibleSelectionTemplate(const SelectionTemplate<Strategy>&, TextGranularity);
void Validate(TextGranularity = kCharacterGranularity);
@@ -193,6 +199,14 @@ CORE_EXPORT VisibleSelection CreateVisibleSelection(const SelectionInDOMTree&);
CORE_EXPORT VisibleSelectionInFlatTree
CreateVisibleSelection(const SelectionInFlatTree&);
+CORE_EXPORT VisibleSelection
+CreateVisibleSelectionWithGranularity(const SelectionInDOMTree&,
+ TextGranularity);
+
+CORE_EXPORT VisibleSelectionInFlatTree
+CreateVisibleSelectionWithGranularity(const SelectionInFlatTree&,
+ TextGranularity);
+
// We don't yet support multi-range selections, so we only ever have one range
// to return.
CORE_EXPORT EphemeralRange FirstEphemeralRangeOf(const VisibleSelection&);

Powered by Google App Engine
This is Rietveld 408576698