| 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 21 matching lines...) Expand all Loading... |
| 32 #include "core/editing/VisibleSelection.h" | 32 #include "core/editing/VisibleSelection.h" |
| 33 #include "core/page/EventWithHitTestResults.h" | 33 #include "core/page/EventWithHitTestResults.h" |
| 34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class FrameSelection; | 38 class FrameSelection; |
| 39 class HitTestResult; | 39 class HitTestResult; |
| 40 class LocalFrame; | 40 class LocalFrame; |
| 41 | 41 |
| 42 class SelectionController final : public NoBaseWillBeGarbageCollected<SelectionC
ontroller> { | 42 class SelectionController final : public GarbageCollected<SelectionController> { |
| 43 WTF_MAKE_NONCOPYABLE(SelectionController); | 43 WTF_MAKE_NONCOPYABLE(SelectionController); |
| 44 USING_FAST_MALLOC_WILL_BE_REMOVED(SelectionController); | |
| 45 public: | 44 public: |
| 46 static PassOwnPtrWillBeRawPtr<SelectionController> create(LocalFrame&); | 45 static RawPtr<SelectionController> create(LocalFrame&); |
| 47 DECLARE_TRACE(); | 46 DECLARE_TRACE(); |
| 48 | 47 |
| 49 void handleMousePressEvent(const MouseEventWithHitTestResults&); | 48 void handleMousePressEvent(const MouseEventWithHitTestResults&); |
| 50 bool handleMousePressEventSingleClick(const MouseEventWithHitTestResults&); | 49 bool handleMousePressEventSingleClick(const MouseEventWithHitTestResults&); |
| 51 bool handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&); | 50 bool handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&); |
| 52 bool handleMousePressEventTripleClick(const MouseEventWithHitTestResults&); | 51 bool handleMousePressEventTripleClick(const MouseEventWithHitTestResults&); |
| 53 void handleMouseDraggedEvent(const MouseEventWithHitTestResults&, const IntP
oint&, const LayoutPoint&, Node*, const IntPoint&); | 52 void handleMouseDraggedEvent(const MouseEventWithHitTestResults&, const IntP
oint&, const LayoutPoint&, Node*, const IntPoint&); |
| 54 bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&, const Layo
utPoint&); | 53 bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&, const Layo
utPoint&); |
| 55 bool handlePasteGlobalSelection(const PlatformMouseEvent&); | 54 bool handlePasteGlobalSelection(const PlatformMouseEvent&); |
| 56 bool handleGestureLongPress(const PlatformGestureEvent&, const HitTestResult
&); | 55 bool handleGestureLongPress(const PlatformGestureEvent&, const HitTestResult
&); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 bool handleMouseReleaseEventAlgorithm(const MouseEventWithHitTestResults&, c
onst LayoutPoint&); | 98 bool handleMouseReleaseEventAlgorithm(const MouseEventWithHitTestResults&, c
onst LayoutPoint&); |
| 100 | 99 |
| 101 template <typename Strategy> | 100 template <typename Strategy> |
| 102 void passMousePressEventToSubframeAlgorithm(const MouseEventWithHitTestResul
ts&); | 101 void passMousePressEventToSubframeAlgorithm(const MouseEventWithHitTestResul
ts&); |
| 103 | 102 |
| 104 template <typename Strategy> | 103 template <typename Strategy> |
| 105 bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleS
electionTemplate<Strategy>&, TextGranularity); | 104 bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleS
electionTemplate<Strategy>&, TextGranularity); |
| 106 | 105 |
| 107 FrameSelection& selection() const; | 106 FrameSelection& selection() const; |
| 108 | 107 |
| 109 RawPtrWillBeMember<LocalFrame> const m_frame; | 108 Member<LocalFrame> const m_frame; |
| 110 bool m_mouseDownMayStartSelect; | 109 bool m_mouseDownMayStartSelect; |
| 111 bool m_mouseDownWasSingleClickInSelection; | 110 bool m_mouseDownWasSingleClickInSelection; |
| 112 bool m_mouseDownAllowsMultiClick; | 111 bool m_mouseDownAllowsMultiClick; |
| 113 enum class SelectionState { HaveNotStartedSelection, PlacedCaret, ExtendedSe
lection }; | 112 enum class SelectionState { HaveNotStartedSelection, PlacedCaret, ExtendedSe
lection }; |
| 114 SelectionState m_selectionState; | 113 SelectionState m_selectionState; |
| 115 }; | 114 }; |
| 116 | 115 |
| 117 } // namespace blink | 116 } // namespace blink |
| 118 | 117 |
| 119 #endif // SelectionController_h | 118 #endif // SelectionController_h |
| OLD | NEW |