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
3 // found in the LICENSE file.
8 #include "modules/EventModules.h"
9 #include "modules/gamepad/Gamepad.h"
13 struct GamepadEventInit : public EventInit {
16 Member<Gamepad> gamepad;
19 class GamepadEvent FINAL : public Event {
21 static PassRefPtrWillBeRawPtr<GamepadEvent> create()
23 return adoptRefWillBeNoop(new GamepadEvent);
25 static PassRefPtrWillBeRawPtr<GamepadEvent> create(const AtomicString& type, bool canBubble, bool cancelable, Gamepad* gamepad)
27 return adoptRefWillBeNoop(new GamepadEvent(type, canBubble, cancelable, gamepad));
29 static PassRefPtrWillBeRawPtr<GamepadEvent> create(const AtomicString& type, const GamepadEventInit& initializer)
31 return adoptRefWillBeNoop(new GamepadEvent(type, initializer));
33 virtual ~GamepadEvent();
35 Gamepad* gamepad() const { return m_gamepad.get(); }
37 virtual const AtomicString& interfaceName() const OVERRIDE;
39 virtual void trace(Visitor*) OVERRIDE;
43 GamepadEvent(const AtomicString& type, bool canBubble, bool cancelable, Gamepad*);
44 GamepadEvent(const AtomicString&, const GamepadEventInit&);
46 PersistentWillBeMember<Gamepad> m_gamepad;
51 #endif // GamepadEvent_h