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

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: sourceDevice set to null from Javascript 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.
(...skipping 10 matching lines...) Expand all
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 26
27 namespace blink { 27 namespace blink {
28 28
29 UIEvent::UIEvent() 29 UIEvent::UIEvent()
30 : m_detail(0) 30 : m_detail(0)
31 , m_sourceDevice(nullptr)
31 { 32 {
32 } 33 }
33 34
34 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) 35 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg, InputDevice* sourceDeviceArg)
35 : Event(eventType, canBubbleArg, cancelableArg) 36 : Event(eventType, canBubbleArg, cancelableArg)
36 , m_view(viewArg) 37 , m_view(viewArg)
37 , m_detail(detailArg) 38 , m_detail(detailArg)
39 , m_sourceDevice(sourceDeviceArg)
38 { 40 {
39 } 41 }
40 42
43 // TODO(lanwei): Will add sourceDevice to all the subclass of UIEvent later, see https://crbug.com/476530.
44 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg)
45 : UIEvent(eventType, canBubbleArg, cancelableArg, viewArg, detailArg, nullpt r)
46 {
47 }
48
41 UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer) 49 UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer)
42 : Event(eventType, initializer) 50 : Event(eventType, initializer)
43 , m_view(initializer.view()) 51 , m_view(initializer.view())
44 , m_detail(initializer.detail()) 52 , m_detail(initializer.detail())
53 , m_sourceDevice(initializer.sourceDevice())
45 { 54 {
46 } 55 }
47 56
48 UIEvent::~UIEvent() 57 UIEvent::~UIEvent()
49 { 58 {
50 } 59 }
51 60
52 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool c ancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) 61 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool c ancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg)
53 { 62 {
54 if (dispatched()) 63 if (dispatched())
55 return; 64 return;
56 65
57 initEvent(typeArg, canBubbleArg, cancelableArg); 66 initEvent(typeArg, canBubbleArg, cancelableArg);
58 67
59 m_view = viewArg; 68 m_view = viewArg;
60 m_detail = detailArg; 69 m_detail = detailArg;
70 m_sourceDevice = nullptr;
61 } 71 }
62 72
63 bool UIEvent::isUIEvent() const 73 bool UIEvent::isUIEvent() const
64 { 74 {
65 return true; 75 return true;
66 } 76 }
67 77
68 const AtomicString& UIEvent::interfaceName() const 78 const AtomicString& UIEvent::interfaceName() const
69 { 79 {
70 return EventNames::UIEvent; 80 return EventNames::UIEvent;
(...skipping 30 matching lines...) Expand all
101 } 111 }
102 112
103 int UIEvent::which() const 113 int UIEvent::which() const
104 { 114 {
105 return 0; 115 return 0;
106 } 116 }
107 117
108 DEFINE_TRACE(UIEvent) 118 DEFINE_TRACE(UIEvent)
109 { 119 {
110 visitor->trace(m_view); 120 visitor->trace(m_view);
121 visitor->trace(m_sourceDevice);
111 Event::trace(visitor); 122 Event::trace(visitor);
112 } 123 }
113 124
114 } // namespace blink 125 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698