OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #include "platform/RuntimeEnabledFeatures.h" | 93 #include "platform/RuntimeEnabledFeatures.h" |
94 #include "platform/TraceEvent.h" | 94 #include "platform/TraceEvent.h" |
95 #include "platform/WindowsKeyboardCodes.h" | 95 #include "platform/WindowsKeyboardCodes.h" |
96 #include "platform/geometry/FloatPoint.h" | 96 #include "platform/geometry/FloatPoint.h" |
97 #include "platform/graphics/Image.h" | 97 #include "platform/graphics/Image.h" |
98 #include "platform/heap/Handle.h" | 98 #include "platform/heap/Handle.h" |
99 #include "platform/scroll/ScrollAnimatorBase.h" | 99 #include "platform/scroll/ScrollAnimatorBase.h" |
100 #include "platform/scroll/Scrollbar.h" | 100 #include "platform/scroll/Scrollbar.h" |
101 #include "wtf/Assertions.h" | 101 #include "wtf/Assertions.h" |
102 #include "wtf/CurrentTime.h" | 102 #include "wtf/CurrentTime.h" |
| 103 #include "wtf/PtrUtil.h" |
103 #include "wtf/StdLibExtras.h" | 104 #include "wtf/StdLibExtras.h" |
104 #include "wtf/TemporaryChange.h" | 105 #include "wtf/TemporaryChange.h" |
| 106 #include <memory> |
105 | 107 |
106 namespace blink { | 108 namespace blink { |
107 | 109 |
108 namespace { | 110 namespace { |
109 | 111 |
110 // Refetch the event target node if it is removed or currently is the shadow nod
e inside an <input> element. | 112 // Refetch the event target node if it is removed or currently is the shadow nod
e inside an <input> element. |
111 // If a mouse event handler changes the input element type to one that has a wid
get associated, | 113 // If a mouse event handler changes the input element type to one that has a wid
get associated, |
112 // we'd like to EventHandler::handleMousePressEvent to pass the event to the wid
get and thus the | 114 // we'd like to EventHandler::handleMousePressEvent to pass the event to the wid
get and thus the |
113 // event target node can't still be the shadow node. | 115 // event target node can't still be the shadow node. |
114 bool shouldRefetchEventTarget(const MouseEventWithHitTestResults& mev) | 116 bool shouldRefetchEventTarget(const MouseEventWithHitTestResults& mev) |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 | 1109 |
1108 // For 4th/5th button in the mouse since Chrome does not yet send | 1110 // For 4th/5th button in the mouse since Chrome does not yet send |
1109 // button value to Blink but in some cases it does send the event. | 1111 // button value to Blink but in some cases it does send the event. |
1110 // This check is needed to suppress such an event (crbug.com/574959) | 1112 // This check is needed to suppress such an event (crbug.com/574959) |
1111 if (mouseEvent.button() == NoButton) | 1113 if (mouseEvent.button() == NoButton) |
1112 return WebInputEventResult::HandledSuppressed; | 1114 return WebInputEventResult::HandledSuppressed; |
1113 | 1115 |
1114 if (!mouseEvent.fromTouch()) | 1116 if (!mouseEvent.fromTouch()) |
1115 m_frame->selection().setCaretBlinkingSuspended(false); | 1117 m_frame->selection().setCaretBlinkingSuspended(false); |
1116 | 1118 |
1117 OwnPtr<UserGestureIndicator> gestureIndicator; | 1119 std::unique_ptr<UserGestureIndicator> gestureIndicator; |
1118 | 1120 |
1119 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke
n) | 1121 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke
n) |
1120 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame
Root()->eventHandler().m_lastMouseDownUserGestureToken.release())); | 1122 gestureIndicator = wrapUnique(new UserGestureIndicator(m_frame->localFra
meRoot()->eventHandler().m_lastMouseDownUserGestureToken.release())); |
1121 else | 1123 else |
1122 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin
gUserGesture)); | 1124 gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProcess
ingUserGesture)); |
1123 | 1125 |
1124 #if OS(WIN) | 1126 #if OS(WIN) |
1125 if (Page* page = m_frame->page()) | 1127 if (Page* page = m_frame->page()) |
1126 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame,
mouseEvent); | 1128 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame,
mouseEvent); |
1127 #endif | 1129 #endif |
1128 | 1130 |
1129 m_mousePressed = false; | 1131 m_mousePressed = false; |
1130 setLastKnownMousePosition(mouseEvent); | 1132 setLastKnownMousePosition(mouseEvent); |
1131 | 1133 |
1132 if (m_svgPan) { | 1134 if (m_svgPan) { |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2848 | 2850 |
2849 FrameHost* EventHandler::frameHost() const | 2851 FrameHost* EventHandler::frameHost() const |
2850 { | 2852 { |
2851 if (!m_frame->page()) | 2853 if (!m_frame->page()) |
2852 return nullptr; | 2854 return nullptr; |
2853 | 2855 |
2854 return &m_frame->page()->frameHost(); | 2856 return &m_frame->page()->frameHost(); |
2855 } | 2857 } |
2856 | 2858 |
2857 } // namespace blink | 2859 } // namespace blink |
OLD | NEW |