Chromium Code Reviews| Index: Source/core/page/EventHandler.h |
| diff --git a/Source/core/page/EventHandler.h b/Source/core/page/EventHandler.h |
| index eeb7df8c47208340f4bf9b8bb84a63aad03ad6f6..6b6f9219893391a86f4f4b9e0d93c79642cf2fd1 100644 |
| --- a/Source/core/page/EventHandler.h |
| +++ b/Source/core/page/EventHandler.h |
| @@ -27,7 +27,6 @@ |
| #define EventHandler_h |
| #include "core/CoreExport.h" |
| -#include "core/editing/TextGranularity.h" |
| #include "core/events/TextEventInputType.h" |
| #include "core/layout/HitTestRequest.h" |
| #include "core/style/ComputedStyleConstants.h" |
| @@ -76,12 +75,11 @@ class LayoutObject; |
| class ScrollableArea; |
| class Scrollbar; |
| class ScrollState; |
| +class SelectionController; |
| class TextEvent; |
| -class VisibleSelection; |
| class WheelEvent; |
| class Widget; |
| -enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTrailingWhitespace }; |
| enum class DragInitiator; |
| class CORE_EXPORT EventHandler : public NoBaseWillBeGarbageCollectedFinalized<EventHandler> { |
| @@ -94,8 +92,6 @@ public: |
| void clear(); |
| void nodeWillBeRemoved(Node&); |
| - void updateSelectionForMouseDrag(); |
| - |
| #if OS(WIN) |
| void startPanScrolling(LayoutObject*); |
| #endif |
| @@ -196,31 +192,25 @@ public: |
| PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { return m_lastMouseDownUserGestureToken.release(); } |
| int clickCount() { return m_clickCount; } |
| - bool mouseDownWasSingleClickInSelection() { return m_mouseDownWasSingleClickInSelection; } |
| + |
| + void updateSelectionForMouseDrag(); |
| + SelectionController& selectionController() const |
| + { |
| + ASSERT(m_selectionController); |
| + return *m_selectionController; |
| + } |
| private: |
| static DragState& dragState(); |
| DataTransfer* createDraggingDataTransfer() const; |
| - bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleSelection&, TextGranularity); |
| - void selectClosestWordFromHitTestResult(const HitTestResult&, AppendTrailingWhitespace); |
| - void selectClosestMisspellingFromHitTestResult(const HitTestResult&, AppendTrailingWhitespace); |
| - void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&); |
| - void selectClosestMisspellingFromMouseEvent(const MouseEventWithHitTestResults&); |
| - void selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults&); |
| - |
| bool handleMouseMoveOrLeaveEvent(const PlatformMouseEvent&, HitTestResult* hoveredNode = nullptr, bool onlyUpdateScrollbars = false, bool forceLeave = false); |
| bool handleMousePressEvent(const MouseEventWithHitTestResults&); |
| - bool handleMousePressEventSingleClick(const MouseEventWithHitTestResults&); |
| - bool handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&); |
| - bool handleMousePressEventTripleClick(const MouseEventWithHitTestResults&); |
| bool handleMouseFocus(const MouseEventWithHitTestResults&); |
| bool handleMouseDraggedEvent(const MouseEventWithHitTestResults&); |
| bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&); |
| - bool handlePasteGlobalSelection(const PlatformMouseEvent&); |
| - |
| HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::Type); |
| void applyTouchAdjustment(PlatformGestureEvent*, HitTestResult*); |
| bool handleGestureTap(const GestureEventWithHitTestResults&); |
| @@ -239,8 +229,6 @@ private: |
| void cursorUpdateTimerFired(Timer<EventHandler>*); |
| void activeIntervalTimerFired(Timer<EventHandler>*); |
| - bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; } |
| - |
| void fakeMouseMoveEventTimerFired(Timer<EventHandler>*); |
| void cancelFakeMouseMoveEvent(); |
| bool isCursorVisible() const; |
| @@ -303,8 +291,6 @@ private: |
| void defaultEscapeEventHandler(KeyboardEvent*); |
| void defaultArrowEventHandler(WebFocusType, KeyboardEvent*); |
| - void updateSelectionForMouseDrag(const HitTestResult&); |
| - |
| void updateLastScrollbarUnderMouse(Scrollbar*, bool); |
| void setFrameWasScrolledByUser(); |
| @@ -336,11 +322,8 @@ private: |
| bool m_capturesDragging; |
| RefPtrWillBeMember<Node> m_mousePressNode; |
| - bool m_mouseDownMayStartSelect; |
| bool m_mouseDownMayStartDrag; |
| - bool m_mouseDownWasSingleClickInSelection; |
| - enum SelectionInitiationState { HaveNotStartedSelection, PlacedCaret, ExtendedSelection }; |
| - SelectionInitiationState m_selectionInitiationState; |
| + OwnPtrWillBeMember<SelectionController> m_selectionController; |
|
Rick Byers
2015/05/01 13:22:09
There's a 1:1 correspondance and identical lifetim
Miyoung Shin(g)
2015/05/03 01:45:24
Oh. right. Thanks for making it simpler.
|
| LayoutPoint m_dragStartPos; |