| 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 10 matching lines...) Expand all Loading... |
| 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 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/editing/FrameSelection.h" |
| 31 #include "core/editing/TextGranularity.h" | 32 #include "core/editing/TextGranularity.h" |
| 32 #include "core/editing/VisibleSelection.h" | 33 #include "core/editing/VisibleSelection.h" |
| 33 #include "core/page/EventWithHitTestResults.h" | 34 #include "core/page/EventWithHitTestResults.h" |
| 34 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
| 35 | 36 |
| 36 namespace blink { | 37 namespace blink { |
| 37 | 38 |
| 38 class FrameSelection; | |
| 39 class HitTestResult; | 39 class HitTestResult; |
| 40 class LocalFrame; | 40 class LocalFrame; |
| 41 | 41 |
| 42 class SelectionController final : public GarbageCollected<SelectionController> { | 42 class SelectionController final : public GarbageCollected<SelectionController> { |
| 43 WTF_MAKE_NONCOPYABLE(SelectionController); | 43 WTF_MAKE_NONCOPYABLE(SelectionController); |
| 44 | 44 |
| 45 public: | 45 public: |
| 46 static SelectionController* create(LocalFrame&); | 46 static SelectionController* create(LocalFrame&); |
| 47 DECLARE_TRACE(); | 47 DECLARE_TRACE(); |
| 48 | 48 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, | 91 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, |
| 92 AppendTrailingWhitespace); | 92 AppendTrailingWhitespace); |
| 93 void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&); | 93 void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&); |
| 94 void selectClosestMisspellingFromMouseEvent( | 94 void selectClosestMisspellingFromMouseEvent( |
| 95 const MouseEventWithHitTestResults&); | 95 const MouseEventWithHitTestResults&); |
| 96 void selectClosestWordOrLinkFromMouseEvent( | 96 void selectClosestWordOrLinkFromMouseEvent( |
| 97 const MouseEventWithHitTestResults&); | 97 const MouseEventWithHitTestResults&); |
| 98 bool updateSelectionForMouseDownDispatchingSelectStart( | 98 bool updateSelectionForMouseDownDispatchingSelectStart( |
| 99 Node*, | 99 Node*, |
| 100 const VisibleSelectionInFlatTree&, | 100 const VisibleSelectionInFlatTree&, |
| 101 TextGranularity); | 101 TextGranularity, |
| 102 HandleVisibility); |
| 102 | 103 |
| 103 FrameSelection& selection() const; | 104 FrameSelection& selection() const; |
| 104 | 105 |
| 105 Member<LocalFrame> const m_frame; | 106 Member<LocalFrame> const m_frame; |
| 106 bool m_mouseDownMayStartSelect; | 107 bool m_mouseDownMayStartSelect; |
| 107 bool m_mouseDownWasSingleClickInSelection; | 108 bool m_mouseDownWasSingleClickInSelection; |
| 108 bool m_mouseDownAllowsMultiClick; | 109 bool m_mouseDownAllowsMultiClick; |
| 109 enum class SelectionState { | 110 enum class SelectionState { |
| 110 HaveNotStartedSelection, | 111 HaveNotStartedSelection, |
| 111 PlacedCaret, | 112 PlacedCaret, |
| 112 ExtendedSelection | 113 ExtendedSelection |
| 113 }; | 114 }; |
| 114 SelectionState m_selectionState; | 115 SelectionState m_selectionState; |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 bool isLinkSelection(const MouseEventWithHitTestResults&); | 118 bool isLinkSelection(const MouseEventWithHitTestResults&); |
| 118 bool isExtendingSelection(const MouseEventWithHitTestResults&); | 119 bool isExtendingSelection(const MouseEventWithHitTestResults&); |
| 119 | 120 |
| 120 } // namespace blink | 121 } // namespace blink |
| 121 | 122 |
| 122 #endif // SelectionController_h | 123 #endif // SelectionController_h |
| OLD | NEW |