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 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class FloatPoint; | 54 class FloatPoint; |
55 class FloatQuad; | 55 class FloatQuad; |
56 class HitTestRequest; | 56 class HitTestRequest; |
57 class HitTestResult; | 57 class HitTestResult; |
58 class KeyboardEvent; | 58 class KeyboardEvent; |
59 class LocalFrame; | 59 class LocalFrame; |
60 class Node; | 60 class Node; |
61 class OptionalCursor; | 61 class OptionalCursor; |
62 class PlatformGestureEvent; | 62 class PlatformGestureEvent; |
63 class PlatformKeyboardEvent; | 63 class PlatformKeyboardEvent; |
64 class PlatformTouchEvent; | |
65 class RenderLayer; | 64 class RenderLayer; |
66 class RenderLayerScrollableArea; | 65 class RenderLayerScrollableArea; |
67 class RenderObject; | 66 class RenderObject; |
68 class ScrollableArea; | 67 class ScrollableArea; |
69 class Scrollbar; | 68 class Scrollbar; |
70 class TextEvent; | 69 class TextEvent; |
71 class TouchEvent; | |
72 class VisibleSelection; | 70 class VisibleSelection; |
73 class Widget; | 71 class Widget; |
74 | 72 |
75 typedef EventWithHitTestResults<PlatformGestureEvent> GestureEventWithHitTestRes
ults; | 73 typedef EventWithHitTestResults<PlatformGestureEvent> GestureEventWithHitTestRes
ults; |
76 | 74 |
77 enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTraili
ngWhitespace }; | 75 enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTraili
ngWhitespace }; |
78 enum CheckDragHysteresis { ShouldCheckDragHysteresis, DontCheckDragHysteresis }; | 76 enum CheckDragHysteresis { ShouldCheckDragHysteresis, DontCheckDragHysteresis }; |
79 | 77 |
80 class EventHandler { | 78 class EventHandler { |
81 WTF_MAKE_NONCOPYABLE(EventHandler); | 79 WTF_MAKE_NONCOPYABLE(EventHandler); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 bool keyEvent(const PlatformKeyboardEvent&); | 130 bool keyEvent(const PlatformKeyboardEvent&); |
133 void defaultKeyboardEventHandler(KeyboardEvent*); | 131 void defaultKeyboardEventHandler(KeyboardEvent*); |
134 | 132 |
135 bool handleTextInputEvent(const String& text, Event* underlyingEvent = 0, Te
xtEventInputType = TextEventInputKeyboard); | 133 bool handleTextInputEvent(const String& text, Event* underlyingEvent = 0, Te
xtEventInputType = TextEventInputKeyboard); |
136 void defaultTextInputEventHandler(TextEvent*); | 134 void defaultTextInputEventHandler(TextEvent*); |
137 | 135 |
138 void focusDocumentView(); | 136 void focusDocumentView(); |
139 | 137 |
140 void capsLockStateMayHaveChanged(); // Only called by FrameSelection | 138 void capsLockStateMayHaveChanged(); // Only called by FrameSelection |
141 | 139 |
142 bool handleTouchEvent(const PlatformTouchEvent&); | |
143 | |
144 bool useHandCursor(Node*, bool isOverLink); | 140 bool useHandCursor(Node*, bool isOverLink); |
145 | 141 |
146 void notifyElementActivated(); | 142 void notifyElementActivated(); |
147 | 143 |
148 private: | 144 private: |
149 bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleS
election&, TextGranularity); | 145 bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleS
election&, TextGranularity); |
150 void selectClosestWordFromHitTestResult(const HitTestResult&, AppendTrailing
Whitespace); | 146 void selectClosestWordFromHitTestResult(const HitTestResult&, AppendTrailing
Whitespace); |
151 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, AppendT
railingWhitespace); | 147 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, AppendT
railingWhitespace); |
152 | 148 |
153 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::T
ype); | 149 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::T
ype); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 RefPtr<Node> m_dragTarget; | 238 RefPtr<Node> m_dragTarget; |
243 bool m_shouldOnlyFireDragOverEvent; | 239 bool m_shouldOnlyFireDragOverEvent; |
244 | 240 |
245 bool m_mousePositionIsUnknown; | 241 bool m_mousePositionIsUnknown; |
246 IntPoint m_lastKnownMousePosition; | 242 IntPoint m_lastKnownMousePosition; |
247 IntPoint m_lastKnownMouseGlobalPosition; | 243 IntPoint m_lastKnownMouseGlobalPosition; |
248 IntPoint m_mouseDownPos; // In our view's coords. | 244 IntPoint m_mouseDownPos; // In our view's coords. |
249 | 245 |
250 RefPtr<Node> m_previousWheelScrolledNode; | 246 RefPtr<Node> m_previousWheelScrolledNode; |
251 | 247 |
252 // The target of each active touch point indexed by the touch ID. | |
253 typedef HashMap<unsigned, RefPtr<EventTarget>, DefaultHash<unsigned>::Hash,
WTF::UnsignedWithZeroKeyHashTraits<unsigned> > TouchTargetMap; | |
254 TouchTargetMap m_targetForTouchID; | |
255 | |
256 // If set, the document of the active touch sequence. Unset if no touch sequ
ence active. | |
257 RefPtr<Document> m_touchSequenceDocument; | |
258 | |
259 bool m_touchPressed; | |
260 | |
261 RefPtr<Node> m_scrollGestureHandlingNode; | 248 RefPtr<Node> m_scrollGestureHandlingNode; |
262 bool m_lastGestureScrollOverWidget; | 249 bool m_lastGestureScrollOverWidget; |
263 RefPtr<Node> m_previousGestureScrolledNode; | 250 RefPtr<Node> m_previousGestureScrolledNode; |
264 RefPtr<Scrollbar> m_scrollbarHandlingScrollGesture; | 251 RefPtr<Scrollbar> m_scrollbarHandlingScrollGesture; |
265 | 252 |
266 double m_maxMouseMovedDuration; | 253 double m_maxMouseMovedDuration; |
267 bool m_didStartDrag; | 254 bool m_didStartDrag; |
268 | 255 |
269 Timer<EventHandler> m_activeIntervalTimer; | 256 Timer<EventHandler> m_activeIntervalTimer; |
270 double m_lastShowPressTimestamp; | 257 double m_lastShowPressTimestamp; |
271 RefPtr<Element> m_lastDeferredTapElement; | 258 RefPtr<Element> m_lastDeferredTapElement; |
272 }; | 259 }; |
273 | 260 |
274 } // namespace blink | 261 } // namespace blink |
275 | 262 |
276 #endif // SKY_ENGINE_CORE_PAGE_EVENTHANDLER_H_ | 263 #endif // SKY_ENGINE_CORE_PAGE_EVENTHANDLER_H_ |
OLD | NEW |