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

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

Issue 1161783006: Populates sourceDevice attribute into TouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 */ 21 */
22 22
23 #include "config.h" 23 #include "config.h"
24 #include "core/events/UIEvent.h" 24 #include "core/events/UIEvent.h"
25 25
26
27 namespace blink { 26 namespace blink {
28 27
29 UIEvent::UIEvent() 28 UIEvent::UIEvent()
30 : m_detail(0) 29 : m_detail(0)
30 , m_sourceDevice(InputDevice::nonTouchEventInstance())
31 {
32 }
33
34 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg, PassRefPtrWi llBeRawPtr<InputDevice> sourceDeviceArg)
35 : Event(eventType, canBubbleArg, cancelableArg)
36 , m_view(viewArg)
37 , m_detail(detailArg)
38 , m_sourceDevice(sourceDeviceArg)
31 { 39 {
32 } 40 }
33 41
34 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) 42 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg)
35 : Event(eventType, canBubbleArg, cancelableArg) 43 : UIEvent(eventType, canBubbleArg, cancelableArg, viewArg, detailArg, InputD evice::nonTouchEventInstance())
36 , m_view(viewArg)
37 , m_detail(detailArg)
38 { 44 {
39 } 45 }
40 46
41 UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer) 47 UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer)
42 : Event(eventType, initializer) 48 : Event(eventType, initializer)
43 , m_view(initializer.view()) 49 , m_view(initializer.view())
44 , m_detail(initializer.detail()) 50 , m_detail(initializer.detail())
51 , m_sourceDevice(initializer.sourceDevice())
45 { 52 {
46 } 53 }
47 54
48 UIEvent::~UIEvent() 55 UIEvent::~UIEvent()
49 { 56 {
50 } 57 }
51 58
52 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool c ancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) 59 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool c ancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) // , const InputDevice& sourceDeviceArg
53 { 60 {
54 if (dispatched()) 61 if (dispatched())
55 return; 62 return;
56 63
57 initEvent(typeArg, canBubbleArg, cancelableArg); 64 initEvent(typeArg, canBubbleArg, cancelableArg);
58 65
59 m_view = viewArg; 66 m_view = viewArg;
60 m_detail = detailArg; 67 m_detail = detailArg;
68 // m_sourceDevice = ;
61 } 69 }
62 70
63 bool UIEvent::isUIEvent() const 71 bool UIEvent::isUIEvent() const
64 { 72 {
65 return true; 73 return true;
66 } 74 }
67 75
68 const AtomicString& UIEvent::interfaceName() const 76 const AtomicString& UIEvent::interfaceName() const
69 { 77 {
70 return EventNames::UIEvent; 78 return EventNames::UIEvent;
(...skipping 30 matching lines...) Expand all
101 } 109 }
102 110
103 int UIEvent::which() const 111 int UIEvent::which() const
104 { 112 {
105 return 0; 113 return 0;
106 } 114 }
107 115
108 DEFINE_TRACE(UIEvent) 116 DEFINE_TRACE(UIEvent)
109 { 117 {
110 visitor->trace(m_view); 118 visitor->trace(m_view);
119 visitor->trace(m_sourceDevice);
111 Event::trace(visitor); 120 Event::trace(visitor);
112 } 121 }
113 122
114 } // namespace blink 123 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698