Chromium Code Reviews| 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 282f0666f72d8e1803d0e3a41f87abbb3e8b3ab5..6c5fce977f6990eab0cd0719e8c318bfac0129a7 100644 |
| --- a/third_party/WebKit/Source/core/editing/VisibleSelection.h |
| +++ b/third_party/WebKit/Source/core/editing/VisibleSelection.h |
| @@ -65,12 +65,18 @@ class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate { |
| const PositionTemplate<Strategy>& base, |
| const PositionTemplate<Strategy>& extent, |
| TextAffinity, |
| - bool isDirectional); |
| + bool isDirectional, |
| + bool isHandleVisible); |
|
yosin_UTC9
2016/10/07 05:17:59
Please move |isHandleVisible| to |FrameSelection|.
amaralp
2016/10/14 00:53:07
Moved.
|
| static VisibleSelectionTemplate selectionFromContentsOfNode(Node*); |
| SelectionType getSelectionType() const { return m_selectionType; } |
| + void setIsHandleVisible(bool isHandleVisible) { |
| + m_isHandleVisible = isHandleVisible; |
| + } |
| + bool isHandleVisible() const { return m_isHandleVisible; } |
| + |
| void setAffinity(TextAffinity affinity) { m_affinity = affinity; } |
| TextAffinity affinity() const { return m_affinity; } |
| @@ -176,7 +182,8 @@ class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate { |
| VisibleSelectionTemplate(const PositionTemplate<Strategy>& base, |
| const PositionTemplate<Strategy>& extent, |
| TextAffinity, |
| - bool isDirectional); |
| + bool isDirectional, |
| + bool isHandleVisible); |
| void validate(TextGranularity = CharacterGranularity); |
| @@ -217,6 +224,7 @@ class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate { |
| // TODO(yosin): Once we unify start/end and base/extent, we should get rid |
| // of |m_hasTrailingWhitespace|. |
| bool m_hasTrailingWhitespace : 1; |
| + bool m_isHandleVisible : 1; |
| }; |
| extern template class CORE_EXTERN_TEMPLATE_EXPORT |
| @@ -229,99 +237,127 @@ using VisibleSelectionInFlatTree = |
| VisibleSelectionTemplate<EditingInFlatTreeStrategy>; |
| // TODO(xiaochengh): Introduce builder class to get rid of these overloads. |
| -CORE_EXPORT VisibleSelection createVisibleSelection(const Position&, |
| - TextAffinity, |
| - bool isDirectional = false); |
| +CORE_EXPORT VisibleSelection |
| +createVisibleSelection(const Position&, |
| + TextAffinity, |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelection |
| createVisibleSelection(const Position& base, |
| const Position& extent, |
| TextAffinity = SelDefaultAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelection |
| createVisibleSelection(const EphemeralRange&, |
| TextAffinity = SelDefaultAffinity, |
| - bool isDirectional = false); |
| -CORE_EXPORT VisibleSelection createVisibleSelection(const VisiblePosition&, |
| - bool isDirectional = false); |
| -CORE_EXPORT VisibleSelection createVisibleSelection(const VisiblePosition&, |
| - const VisiblePosition&, |
| - bool isDirectional = false); |
| -CORE_EXPORT VisibleSelection createVisibleSelection(const PositionWithAffinity&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| +CORE_EXPORT VisibleSelection |
| +createVisibleSelection(const VisiblePosition&, |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| +CORE_EXPORT VisibleSelection |
| +createVisibleSelection(const VisiblePosition&, |
| + const VisiblePosition&, |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| +CORE_EXPORT VisibleSelection |
| +createVisibleSelection(const PositionWithAffinity&, |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelection(const PositionInFlatTree&, |
| TextAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelection(const PositionInFlatTree& base, |
| const PositionInFlatTree& extent, |
| TextAffinity = SelDefaultAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelection(const EphemeralRangeInFlatTree&, |
| TextAffinity = SelDefaultAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelection(const VisiblePositionInFlatTree&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelection(const VisiblePositionInFlatTree&, |
| const VisiblePositionInFlatTree&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelection(const PositionInFlatTreeWithAffinity&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| // Callers of these functions should ensure clean layout by themselves and then |
| // switch to the proper versions (to be introduced). |
| CORE_EXPORT VisibleSelection |
| createVisibleSelectionDeprecated(const Position&, |
| TextAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelection |
| createVisibleSelectionDeprecated(const Position& base, |
| const Position& extent, |
| TextAffinity = SelDefaultAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelection |
| createVisibleSelectionDeprecated(const EphemeralRange&, |
| TextAffinity = SelDefaultAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelection |
| createVisibleSelectionDeprecated(const VisiblePosition&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelection |
| createVisibleSelectionDeprecated(const VisiblePosition&, |
| const VisiblePosition&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelection |
| createVisibleSelectionDeprecated(const PositionWithAffinity&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelectionDeprecated(const PositionInFlatTree&, |
| TextAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelectionDeprecated(const PositionInFlatTree& base, |
| const PositionInFlatTree& extent, |
| TextAffinity = SelDefaultAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelectionDeprecated(const EphemeralRangeInFlatTree&, |
| TextAffinity = SelDefaultAffinity, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelectionDeprecated(const VisiblePositionInFlatTree&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelectionDeprecated(const VisiblePositionInFlatTree&, |
| const VisiblePositionInFlatTree&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| CORE_EXPORT VisibleSelectionInFlatTree |
| createVisibleSelectionDeprecated(const PositionInFlatTreeWithAffinity&, |
| - bool isDirectional = false); |
| + bool isDirectional = false, |
| + bool isHandleVisible = false); |
| // We don't yet support multi-range selections, so we only ever have one range |
| // to return. |