IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / gamepad / gamepad_standard_mappings.h
blob6b533ca5829c01139e70ac73145613772e14c766
1 // Copyright (c) 2012 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.
5 #ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
8 #include "base/strings/string_piece.h"
10 namespace blink {
11 class WebGamepad;
14 namespace content {
16 typedef void (*GamepadStandardMappingFunction)(
17 const blink::WebGamepad& original,
18 blink::WebGamepad* mapped);
20 GamepadStandardMappingFunction GetGamepadStandardMappingFunction(
21 const base::StringPiece& vendor_id,
22 const base::StringPiece& product_id);
24 // This defines our canonical mapping order for gamepad-like devices. If these
25 // items cannot all be satisfied, it is a case-by-case judgement as to whether
26 // it is better to leave the device unmapped, or to partially map it. In
27 // general, err towards leaving it *unmapped* so that content can handle
28 // appropriately.
30 enum CanonicalButtonIndex {
31 kButtonPrimary,
32 kButtonSecondary,
33 kButtonTertiary,
34 kButtonQuaternary,
35 kButtonLeftShoulder,
36 kButtonRightShoulder,
37 kButtonLeftTrigger,
38 kButtonRightTrigger,
39 kButtonBackSelect,
40 kButtonStart,
41 kButtonLeftThumbstick,
42 kButtonRightThumbstick,
43 kButtonDpadUp,
44 kButtonDpadDown,
45 kButtonDpadLeft,
46 kButtonDpadRight,
47 kButtonMeta,
48 kNumButtons
51 enum CanonicalAxisIndex {
52 kAxisLeftStickX,
53 kAxisLeftStickY,
54 kAxisRightStickX,
55 kAxisRightStickY,
56 kNumAxes
59 } // namespace content
61 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_