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

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

Issue 1160753005: Implement UIEvent.sourceDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add arugment name 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::create(false))
Rick Byers 2015/06/04 14:52:35 These lines that create a source device out of not
31 { 31 {
32 } 32 }
33 33
34 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) 34 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg)
35 : Event(eventType, canBubbleArg, cancelableArg) 35 : Event(eventType, canBubbleArg, cancelableArg)
36 , m_view(viewArg) 36 , m_view(viewArg)
37 , m_detail(detailArg) 37 , m_detail(detailArg)
38 , m_sourceDevice(InputDevice::create(false))
38 { 39 {
39 } 40 }
40 41
41 UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer) 42 UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer)
42 : Event(eventType, initializer) 43 : Event(eventType, initializer)
43 , m_view(initializer.view()) 44 , m_view(initializer.view())
44 , m_detail(initializer.detail()) 45 , m_detail(initializer.detail())
46 , m_sourceDevice(initializer.sourceDevice())
45 { 47 {
46 } 48 }
47 49
48 UIEvent::~UIEvent() 50 UIEvent::~UIEvent()
49 { 51 {
50 } 52 }
51 53
52 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool c ancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) 54 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool c ancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg)
53 { 55 {
54 if (dispatched()) 56 if (dispatched())
55 return; 57 return;
56 58
57 initEvent(typeArg, canBubbleArg, cancelableArg); 59 initEvent(typeArg, canBubbleArg, cancelableArg);
58 60
59 m_view = viewArg; 61 m_view = viewArg;
60 m_detail = detailArg; 62 m_detail = detailArg;
63 m_sourceDevice = InputDevice::create(false);
61 } 64 }
62 65
63 bool UIEvent::isUIEvent() const 66 bool UIEvent::isUIEvent() const
64 { 67 {
65 return true; 68 return true;
66 } 69 }
67 70
68 const AtomicString& UIEvent::interfaceName() const 71 const AtomicString& UIEvent::interfaceName() const
69 { 72 {
70 return EventNames::UIEvent; 73 return EventNames::UIEvent;
(...skipping 30 matching lines...) Expand all
101 } 104 }
102 105
103 int UIEvent::which() const 106 int UIEvent::which() const
104 { 107 {
105 return 0; 108 return 0;
106 } 109 }
107 110
108 DEFINE_TRACE(UIEvent) 111 DEFINE_TRACE(UIEvent)
109 { 112 {
110 visitor->trace(m_view); 113 visitor->trace(m_view);
114 visitor->trace(m_sourceDevice);
111 Event::trace(visitor); 115 Event::trace(visitor);
112 } 116 }
113 117
114 } // namespace blink 118 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698