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

Side by Side Diff: Source/core/events/WheelEvent.cpp

Issue 453493002: Improve detection of touch events when hiding media controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@autoHideControls
Patch Set: Cannot use isSimulated, so define derivesFromTouch Created 6 years, 4 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) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved.
6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 6 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 , m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDelta Y) 55 , m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDelta Y)
56 , m_deltaZ(initializer.deltaZ) 56 , m_deltaZ(initializer.deltaZ)
57 , m_deltaMode(initializer.deltaMode) 57 , m_deltaMode(initializer.deltaMode)
58 { 58 {
59 ScriptWrappable::init(this); 59 ScriptWrappable::init(this);
60 } 60 }
61 61
62 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode, 62 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode,
63 PassRefPtrWillBeRawPtr<AbstractView> view, const IntPoint& screenLocation, c onst IntPoint& pageLocation, 63 PassRefPtrWillBeRawPtr<AbstractView> view, const IntPoint& screenLocation, c onst IntPoint& pageLocation,
64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) 64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
65 : MouseEvent(EventTypeNames::wheel, 65 : MouseEvent(EventTypeNames::wheel, true, true, view, 0, screenLocation.x(), screenLocation.y(),
66 true, true, view, 0, screenLocation.x(), screenLocation.y(), 66 pageLocation.x(), pageLocation.y(), 0, 0, ctrlKey, altKey, shiftKey, met aKey, 0, nullptr,
67 pageLocation.x(), pageLocation.y(), 67 nullptr, false, false)
68 0, 0,
69 ctrlKey, altKey, shiftKey, metaKey, 0, nullptr, nullptr, false)
70 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl ier) 68 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl ier)
71 , m_deltaX(-rawDelta.x()) 69 , m_deltaX(-rawDelta.x())
72 , m_deltaY(-rawDelta.y()) 70 , m_deltaY(-rawDelta.y())
73 , m_deltaZ(0) 71 , m_deltaZ(0)
74 , m_deltaMode(deltaMode) 72 , m_deltaMode(deltaMode)
75 { 73 {
76 ScriptWrappable::init(this); 74 ScriptWrappable::init(this);
77 } 75 }
78 76
79 const AtomicString& WheelEvent::interfaceName() const 77 const AtomicString& WheelEvent::interfaceName() const
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 return toWheelEvent(EventDispatchMediator::event()); 119 return toWheelEvent(EventDispatchMediator::event());
122 } 120 }
123 121
124 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons t 122 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons t
125 { 123 {
126 ASSERT(event()); 124 ASSERT(event());
127 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default Handled(); 125 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default Handled();
128 } 126 }
129 127
130 } // namespace blink 128 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698