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" | |
104 #include "wtf/StdLibExtras.h" | 103 #include "wtf/StdLibExtras.h" |
105 #include "wtf/TemporaryChange.h" | 104 #include "wtf/TemporaryChange.h" |
106 #include <memory> | |
107 | 105 |
108 namespace blink { | 106 namespace blink { |
109 | 107 |
110 namespace { | 108 namespace { |
111 | 109 |
112 // Refetch the event target node if it is removed or currently is the shadow nod
e inside an <input> element. | 110 // Refetch the event target node if it is removed or currently is the shadow nod
e inside an <input> element. |
113 // If a mouse event handler changes the input element type to one that has a wid
get associated, | 111 // If a mouse event handler changes the input element type to one that has a wid
get associated, |
114 // we'd like to EventHandler::handleMousePressEvent to pass the event to the wid
get and thus the | 112 // we'd like to EventHandler::handleMousePressEvent to pass the event to the wid
get and thus the |
115 // event target node can't still be the shadow node. | 113 // event target node can't still be the shadow node. |
116 bool shouldRefetchEventTarget(const MouseEventWithHitTestResults& mev) | 114 bool shouldRefetchEventTarget(const MouseEventWithHitTestResults& mev) |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 | 1107 |
1110 // For 4th/5th button in the mouse since Chrome does not yet send | 1108 // For 4th/5th button in the mouse since Chrome does not yet send |
1111 // button value to Blink but in some cases it does send the event. | 1109 // button value to Blink but in some cases it does send the event. |
1112 // This check is needed to suppress such an event (crbug.com/574959) | 1110 // This check is needed to suppress such an event (crbug.com/574959) |
1113 if (mouseEvent.button() == NoButton) | 1111 if (mouseEvent.button() == NoButton) |
1114 return WebInputEventResult::HandledSuppressed; | 1112 return WebInputEventResult::HandledSuppressed; |
1115 | 1113 |
1116 if (!mouseEvent.fromTouch()) | 1114 if (!mouseEvent.fromTouch()) |
1117 m_frame->selection().setCaretBlinkingSuspended(false); | 1115 m_frame->selection().setCaretBlinkingSuspended(false); |
1118 | 1116 |
1119 std::unique_ptr<UserGestureIndicator> gestureIndicator; | 1117 OwnPtr<UserGestureIndicator> gestureIndicator; |
1120 | 1118 |
1121 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke
n) | 1119 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke
n) |
1122 gestureIndicator = wrapUnique(new UserGestureIndicator(m_frame->localFra
meRoot()->eventHandler().m_lastMouseDownUserGestureToken.release())); | 1120 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame
Root()->eventHandler().m_lastMouseDownUserGestureToken.release())); |
1123 else | 1121 else |
1124 gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProcess
ingUserGesture)); | 1122 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin
gUserGesture)); |
1125 | 1123 |
1126 #if OS(WIN) | 1124 #if OS(WIN) |
1127 if (Page* page = m_frame->page()) | 1125 if (Page* page = m_frame->page()) |
1128 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame,
mouseEvent); | 1126 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame,
mouseEvent); |
1129 #endif | 1127 #endif |
1130 | 1128 |
1131 m_mousePressed = false; | 1129 m_mousePressed = false; |
1132 setLastKnownMousePosition(mouseEvent); | 1130 setLastKnownMousePosition(mouseEvent); |
1133 | 1131 |
1134 if (m_svgPan) { | 1132 if (m_svgPan) { |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2850 | 2848 |
2851 FrameHost* EventHandler::frameHost() const | 2849 FrameHost* EventHandler::frameHost() const |
2852 { | 2850 { |
2853 if (!m_frame->page()) | 2851 if (!m_frame->page()) |
2854 return nullptr; | 2852 return nullptr; |
2855 | 2853 |
2856 return &m_frame->page()->frameHost(); | 2854 return &m_frame->page()->frameHost(); |
2857 } | 2855 } |
2858 | 2856 |
2859 } // namespace blink | 2857 } // namespace blink |
OLD | NEW |