Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / gamepad / WebKitGamepad.h
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.
4
5 #ifndef WebKitGamepad_h
6 #define WebKitGamepad_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "modules/gamepad/GamepadCommon.h"
10 #include "platform/heap/Handle.h"
11 #include "wtf/Vector.h"
12
13 namespace blink {
14
15 class WebKitGamepad FINAL : public GarbageCollectedFinalized<WebKitGamepad>, public GamepadCommon, public ScriptWrappable {
16 public:
17     static WebKitGamepad* create()
18     {
19         return new WebKitGamepad();
20     }
21     ~WebKitGamepad();
22
23     typedef Vector<float> FloatVector;
24
25     const FloatVector& buttons() const { return m_buttons; }
26     void setButtons(unsigned count, const WebGamepadButton* data);
27
28     void trace(Visitor*) { }
29
30 private:
31     WebKitGamepad();
32     FloatVector m_buttons;
33 };
34
35 } // namespace blink
36
37 #endif // WebKitGamepad_h