OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/gamepad/GamepadEvent.h" | 5 #include "modules/gamepad/GamepadEvent.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 GamepadEvent::GamepadEvent() | |
10 { | |
11 } | |
12 | |
13 GamepadEvent::GamepadEvent(const AtomicString& type, bool canBubble, bool cancel
able, Gamepad* gamepad) | 9 GamepadEvent::GamepadEvent(const AtomicString& type, bool canBubble, bool cancel
able, Gamepad* gamepad) |
14 : Event(type, canBubble, cancelable) | 10 : Event(type, canBubble, cancelable) |
15 , m_gamepad(gamepad) | 11 , m_gamepad(gamepad) |
16 { | 12 { |
17 } | 13 } |
18 | 14 |
19 GamepadEvent::GamepadEvent(const AtomicString& type, const GamepadEventInit& ini
tializer) | 15 GamepadEvent::GamepadEvent(const AtomicString& type, const GamepadEventInit& ini
tializer) |
20 : Event(type, initializer) | 16 : Event(type, initializer) |
21 { | 17 { |
22 if (initializer.hasGamepad()) | 18 if (initializer.hasGamepad()) |
23 m_gamepad = initializer.gamepad(); | 19 m_gamepad = initializer.gamepad(); |
24 } | 20 } |
25 | 21 |
26 GamepadEvent::~GamepadEvent() | 22 GamepadEvent::~GamepadEvent() |
27 { | 23 { |
28 } | 24 } |
29 | 25 |
30 const AtomicString& GamepadEvent::interfaceName() const | 26 const AtomicString& GamepadEvent::interfaceName() const |
31 { | 27 { |
32 return EventNames::GamepadEvent; | 28 return EventNames::GamepadEvent; |
33 } | 29 } |
34 | 30 |
35 DEFINE_TRACE(GamepadEvent) | 31 DEFINE_TRACE(GamepadEvent) |
36 { | 32 { |
37 visitor->trace(m_gamepad); | 33 visitor->trace(m_gamepad); |
38 Event::trace(visitor); | 34 Event::trace(visitor); |
39 } | 35 } |
40 | 36 |
41 } // namespace blink | 37 } // namespace blink |
OLD | NEW |