OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2015 Google Inc. All rights reserved. | 3 * Copyright (C) 2015 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 11 matching lines...) Expand all Loading... |
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef SelectionController_h | 27 #ifndef SelectionController_h |
28 #define SelectionController_h | 28 #define SelectionController_h |
29 | 29 |
30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
31 #include "core/dom/SynchronousMutationObserver.h" | 31 #include "core/dom/SynchronousMutationObserver.h" |
| 32 #include "core/editing/FrameSelection.h" |
32 #include "core/editing/TextGranularity.h" | 33 #include "core/editing/TextGranularity.h" |
33 #include "core/editing/VisibleSelection.h" | 34 #include "core/editing/VisibleSelection.h" |
34 #include "core/page/EventWithHitTestResults.h" | 35 #include "core/page/EventWithHitTestResults.h" |
35 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 class FrameSelection; | |
40 class HitTestResult; | 40 class HitTestResult; |
41 class LocalFrame; | 41 class LocalFrame; |
42 | 42 |
43 class CORE_EXPORT SelectionController final | 43 class CORE_EXPORT SelectionController final |
44 : public GarbageCollectedFinalized<SelectionController>, | 44 : public GarbageCollectedFinalized<SelectionController>, |
45 public SynchronousMutationObserver { | 45 public SynchronousMutationObserver { |
46 WTF_MAKE_NONCOPYABLE(SelectionController); | 46 WTF_MAKE_NONCOPYABLE(SelectionController); |
47 USING_GARBAGE_COLLECTED_MIXIN(SelectionController); | 47 USING_GARBAGE_COLLECTED_MIXIN(SelectionController); |
48 | 48 |
49 public: | 49 public: |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 SelectInputEventType); | 105 SelectInputEventType); |
106 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, | 106 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, |
107 AppendTrailingWhitespace); | 107 AppendTrailingWhitespace); |
108 void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&); | 108 void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&); |
109 void selectClosestMisspellingFromMouseEvent( | 109 void selectClosestMisspellingFromMouseEvent( |
110 const MouseEventWithHitTestResults&); | 110 const MouseEventWithHitTestResults&); |
111 void selectClosestWordOrLinkFromMouseEvent( | 111 void selectClosestWordOrLinkFromMouseEvent( |
112 const MouseEventWithHitTestResults&); | 112 const MouseEventWithHitTestResults&); |
113 void setNonDirectionalSelectionIfNeeded(const VisibleSelectionInFlatTree&, | 113 void setNonDirectionalSelectionIfNeeded(const VisibleSelectionInFlatTree&, |
114 TextGranularity, | 114 TextGranularity, |
115 EndPointsAdjustmentMode); | 115 EndPointsAdjustmentMode, |
| 116 HandleVisibility); |
116 void setCaretAtHitTestResult(const HitTestResult&); | 117 void setCaretAtHitTestResult(const HitTestResult&); |
117 bool updateSelectionForMouseDownDispatchingSelectStart( | 118 bool updateSelectionForMouseDownDispatchingSelectStart( |
118 Node*, | 119 Node*, |
119 const VisibleSelectionInFlatTree&, | 120 const VisibleSelectionInFlatTree&, |
120 TextGranularity); | 121 TextGranularity, |
| 122 HandleVisibility); |
121 | 123 |
122 FrameSelection& selection() const; | 124 FrameSelection& selection() const; |
123 | 125 |
124 // Implements |SynchronousMutationObserver|. | 126 // Implements |SynchronousMutationObserver|. |
125 // TODO(yosin): We should relocate |m_originalBaseInFlatTree| when DOM tree | 127 // TODO(yosin): We should relocate |m_originalBaseInFlatTree| when DOM tree |
126 // changed. | 128 // changed. |
127 void contextDestroyed(Document*) final; | 129 void contextDestroyed(Document*) final; |
128 | 130 |
129 Member<LocalFrame> const m_frame; | 131 Member<LocalFrame> const m_frame; |
130 // TODO(yosin): We should use |PositionWIthAffinityInFlatTree| since we | 132 // TODO(yosin): We should use |PositionWIthAffinityInFlatTree| since we |
(...skipping 10 matching lines...) Expand all Loading... |
141 }; | 143 }; |
142 SelectionState m_selectionState; | 144 SelectionState m_selectionState; |
143 }; | 145 }; |
144 | 146 |
145 bool isLinkSelection(const MouseEventWithHitTestResults&); | 147 bool isLinkSelection(const MouseEventWithHitTestResults&); |
146 bool isExtendingSelection(const MouseEventWithHitTestResults&); | 148 bool isExtendingSelection(const MouseEventWithHitTestResults&); |
147 | 149 |
148 } // namespace blink | 150 } // namespace blink |
149 | 151 |
150 #endif // SelectionController_h | 152 #endif // SelectionController_h |
OLD | NEW |