Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2290313002: Remove PlatformKeyboardEvent (Closed)
Patch Set: One more fix Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 #include "core/page/FocusController.h" 81 #include "core/page/FocusController.h"
82 #include "core/page/FrameTree.h" 82 #include "core/page/FrameTree.h"
83 #include "core/page/Page.h" 83 #include "core/page/Page.h"
84 #include "core/page/TouchAdjustment.h" 84 #include "core/page/TouchAdjustment.h"
85 #include "core/page/scrolling/ScrollState.h" 85 #include "core/page/scrolling/ScrollState.h"
86 #include "core/paint/PaintLayer.h" 86 #include "core/paint/PaintLayer.h"
87 #include "core/style/ComputedStyle.h" 87 #include "core/style/ComputedStyle.h"
88 #include "core/style/CursorData.h" 88 #include "core/style/CursorData.h"
89 #include "core/svg/SVGDocumentExtensions.h" 89 #include "core/svg/SVGDocumentExtensions.h"
90 #include "platform/PlatformGestureEvent.h" 90 #include "platform/PlatformGestureEvent.h"
91 #include "platform/PlatformKeyboardEvent.h"
92 #include "platform/PlatformTouchEvent.h" 91 #include "platform/PlatformTouchEvent.h"
93 #include "platform/PlatformWheelEvent.h" 92 #include "platform/PlatformWheelEvent.h"
94 #include "platform/RuntimeEnabledFeatures.h" 93 #include "platform/RuntimeEnabledFeatures.h"
95 #include "platform/TraceEvent.h" 94 #include "platform/TraceEvent.h"
96 #include "platform/WindowsKeyboardCodes.h" 95 #include "platform/WindowsKeyboardCodes.h"
97 #include "platform/geometry/FloatPoint.h" 96 #include "platform/geometry/FloatPoint.h"
98 #include "platform/graphics/Image.h" 97 #include "platform/graphics/Image.h"
99 #include "platform/heap/Handle.h" 98 #include "platform/heap/Handle.h"
100 #include "platform/scroll/ScrollAnimatorBase.h" 99 #include "platform/scroll/ScrollAnimatorBase.h"
101 #include "platform/scroll/Scrollbar.h" 100 #include "platform/scroll/Scrollbar.h"
101 #include "public/platform/WebInputEvent.h"
102 #include "wtf/Assertions.h" 102 #include "wtf/Assertions.h"
103 #include "wtf/CurrentTime.h" 103 #include "wtf/CurrentTime.h"
104 #include "wtf/PtrUtil.h" 104 #include "wtf/PtrUtil.h"
105 #include "wtf/StdLibExtras.h" 105 #include "wtf/StdLibExtras.h"
106 #include <memory> 106 #include <memory>
107 107
108 namespace blink { 108 namespace blink {
109 109
110 namespace { 110 namespace {
111 111
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 if (!view) 2188 if (!view)
2189 return; 2189 return;
2190 2190
2191 if (!m_frame->page() || !m_frame->page()->focusController().isActive()) 2191 if (!m_frame->page() || !m_frame->page()->focusController().isActive())
2192 return; 2192 return;
2193 2193
2194 // Don't dispatch a synthetic mouse move event if the mouse cursor is not vi sible to the user. 2194 // Don't dispatch a synthetic mouse move event if the mouse cursor is not vi sible to the user.
2195 if (!isCursorVisible()) 2195 if (!isCursorVisible())
2196 return; 2196 return;
2197 2197
2198 PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownM ouseGlobalPosition, WebPointerProperties::Button::NoButton, PlatformEvent::Mouse Moved, 0, PlatformKeyboardEvent::getCurrentModifierState(), PlatformMouseEvent:: RealOrIndistinguishable, monotonicallyIncreasingTime(), WebPointerProperties::Po interType::Mouse); 2198 PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownM ouseGlobalPosition, WebPointerProperties::Button::NoButton, PlatformEvent::Mouse Moved, 0, static_cast<PlatformEvent::Modifiers>(KeyboardEventManager::getCurrent ModifierState()), PlatformMouseEvent::RealOrIndistinguishable, monotonicallyIncr easingTime(), WebPointerProperties::PointerType::Mouse);
2199 handleMouseMoveEvent(fakeMouseMoveEvent); 2199 handleMouseMoveEvent(fakeMouseMoveEvent);
2200 } 2200 }
2201 2201
2202 void EventHandler::cancelFakeMouseMoveEvent() 2202 void EventHandler::cancelFakeMouseMoveEvent()
2203 { 2203 {
2204 m_fakeMouseMoveEventTimer.stop(); 2204 m_fakeMouseMoveEventTimer.stop();
2205 } 2205 }
2206 2206
2207 bool EventHandler::isCursorVisible() const 2207 bool EventHandler::isCursorVisible() const
2208 { 2208 {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 } 2254 }
2255 2255
2256 void EventHandler::notifyElementActivated() 2256 void EventHandler::notifyElementActivated()
2257 { 2257 {
2258 // Since another element has been set to active, stop current timer and clea r reference. 2258 // Since another element has been set to active, stop current timer and clea r reference.
2259 if (m_activeIntervalTimer.isActive()) 2259 if (m_activeIntervalTimer.isActive())
2260 m_activeIntervalTimer.stop(); 2260 m_activeIntervalTimer.stop();
2261 m_lastDeferredTapElement = nullptr; 2261 m_lastDeferredTapElement = nullptr;
2262 } 2262 }
2263 2263
2264 bool EventHandler::handleAccessKey(const PlatformKeyboardEvent& evt) 2264 bool EventHandler::handleAccessKey(const WebKeyboardEvent& evt)
2265 { 2265 {
2266 return m_keyboardEventManager.handleAccessKey(evt); 2266 return m_keyboardEventManager.handleAccessKey(evt);
2267 } 2267 }
2268 2268
2269 WebInputEventResult EventHandler::keyEvent(const PlatformKeyboardEvent& initialK eyEvent) 2269 WebInputEventResult EventHandler::keyEvent(const WebKeyboardEvent& initialKeyEve nt)
2270 { 2270 {
2271 return m_keyboardEventManager.keyEvent(initialKeyEvent); 2271 return m_keyboardEventManager.keyEvent(initialKeyEvent);
2272 } 2272 }
2273 2273
2274 void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event) 2274 void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event)
2275 { 2275 {
2276 m_keyboardEventManager.defaultKeyboardEventHandler(event, m_mousePressNode); 2276 m_keyboardEventManager.defaultKeyboardEventHandler(event, m_mousePressNode);
2277 } 2277 }
2278 2278
2279 bool EventHandler::dragHysteresisExceeded(const IntPoint& dragLocationInRootFram e) const 2279 bool EventHandler::dragHysteresisExceeded(const IntPoint& dragLocationInRootFram e) const
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2606 2606
2607 FrameHost* EventHandler::frameHost() const 2607 FrameHost* EventHandler::frameHost() const
2608 { 2608 {
2609 if (!m_frame->page()) 2609 if (!m_frame->page())
2610 return nullptr; 2610 return nullptr;
2611 2611
2612 return &m_frame->page()->frameHost(); 2612 return &m_frame->page()->frameHost();
2613 } 2613 }
2614 2614
2615 } // namespace blink 2615 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698