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

Unified Diff: Source/modules/gamepad/GamepadEvent.h

Issue 200783002: Gamepad API: add support for gamepadconnected and gamepaddisconnected events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: layout fix: webexposed/global-constructors-listing Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/gamepad/GamepadDispatcher.cpp ('k') | Source/modules/gamepad/GamepadEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/gamepad/GamepadEvent.h
diff --git a/Source/modules/gamepad/GamepadEvent.h b/Source/modules/gamepad/GamepadEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..0c966644ffc51183b08d2605e0361a41b7bfaf17
--- /dev/null
+++ b/Source/modules/gamepad/GamepadEvent.h
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GamepadEvent_h
+#define GamepadEvent_h
+
+#include "core/events/Event.h"
+#include "modules/gamepad/Gamepad.h"
+
+namespace WebCore {
+
+struct GamepadEventInit : public EventInit {
+ GamepadEventInit();
+
+ RefPtrWillBeMember<Gamepad> gamepad;
+};
+
+class GamepadEvent FINAL : public Event {
+public:
+ static PassRefPtr<GamepadEvent> create()
+ {
+ return adoptRef(new GamepadEvent);
+ }
+ static PassRefPtr<GamepadEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<Gamepad> gamepad)
+ {
+ return adoptRef(new GamepadEvent(type, canBubble, cancelable, gamepad));
+ }
+ static PassRefPtr<GamepadEvent> create(const AtomicString& type, const GamepadEventInit& initializer)
+ {
+ return adoptRef(new GamepadEvent(type, initializer));
+ }
+ virtual ~GamepadEvent();
+
+ Gamepad* gamepad() const { return m_gamepad.get(); }
+
+ virtual const AtomicString& interfaceName() const OVERRIDE;
+
+ virtual void trace(Visitor*) OVERRIDE;
+
+private:
+ GamepadEvent();
+ GamepadEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<Gamepad>);
+ GamepadEvent(const AtomicString&, const GamepadEventInit&);
+
+ RefPtrWillBePersistent<Gamepad> m_gamepad;
+};
+
+} // namespace WebCore
+
+#endif // GamepadEvent_h
« no previous file with comments | « Source/modules/gamepad/GamepadDispatcher.cpp ('k') | Source/modules/gamepad/GamepadEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698