| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 SelectInputEventType); | 106 SelectInputEventType); |
| 107 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, | 107 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, |
| 108 AppendTrailingWhitespace); | 108 AppendTrailingWhitespace); |
| 109 void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&); | 109 void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&); |
| 110 void selectClosestMisspellingFromMouseEvent( | 110 void selectClosestMisspellingFromMouseEvent( |
| 111 const MouseEventWithHitTestResults&); | 111 const MouseEventWithHitTestResults&); |
| 112 void selectClosestWordOrLinkFromMouseEvent( | 112 void selectClosestWordOrLinkFromMouseEvent( |
| 113 const MouseEventWithHitTestResults&); | 113 const MouseEventWithHitTestResults&); |
| 114 void setNonDirectionalSelectionIfNeeded(const VisibleSelectionInFlatTree&, | 114 void setNonDirectionalSelectionIfNeeded(const VisibleSelectionInFlatTree&, |
| 115 TextGranularity, | 115 TextGranularity, |
| 116 EndPointsAdjustmentMode); | 116 EndPointsAdjustmentMode, |
| 117 HandleVisibility); |
| 117 bool setCaretAtHitTestResult(const HitTestResult&); | 118 bool setCaretAtHitTestResult(const HitTestResult&); |
| 118 bool updateSelectionForMouseDownDispatchingSelectStart( | 119 bool updateSelectionForMouseDownDispatchingSelectStart( |
| 119 Node*, | 120 Node*, |
| 120 const VisibleSelectionInFlatTree&, | 121 const VisibleSelectionInFlatTree&, |
| 121 TextGranularity); | 122 TextGranularity, |
| 123 HandleVisibility); |
| 122 | 124 |
| 123 FrameSelection& selection() const; | 125 FrameSelection& selection() const; |
| 124 | 126 |
| 125 // Implements |SynchronousMutationObserver|. | 127 // Implements |SynchronousMutationObserver|. |
| 126 // TODO(yosin): We should relocate |m_originalBaseInFlatTree| when DOM tree | 128 // TODO(yosin): We should relocate |m_originalBaseInFlatTree| when DOM tree |
| 127 // changed. | 129 // changed. |
| 128 void contextDestroyed() final; | 130 void contextDestroyed() final; |
| 129 | 131 |
| 130 Member<LocalFrame> const m_frame; | 132 Member<LocalFrame> const m_frame; |
| 131 // TODO(yosin): We should use |PositionWIthAffinityInFlatTree| since we | 133 // TODO(yosin): We should use |PositionWIthAffinityInFlatTree| since we |
| (...skipping 10 matching lines...) Expand all Loading... |
| 142 }; | 144 }; |
| 143 SelectionState m_selectionState; | 145 SelectionState m_selectionState; |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 bool isLinkSelection(const MouseEventWithHitTestResults&); | 148 bool isLinkSelection(const MouseEventWithHitTestResults&); |
| 147 bool isExtendingSelection(const MouseEventWithHitTestResults&); | 149 bool isExtendingSelection(const MouseEventWithHitTestResults&); |
| 148 | 150 |
| 149 } // namespace blink | 151 } // namespace blink |
| 150 | 152 |
| 151 #endif // SelectionController_h | 153 #endif // SelectionController_h |
| OLD | NEW |