OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/browser/gamepad/gamepad_platform_data_fetcher_win.h" | 5 #include "content/browser/gamepad/gamepad_platform_data_fetcher_win.h" |
6 | 6 |
7 #include <dinput.h> | 7 #include <dinput.h> |
8 #include <dinputd.h> | 8 #include <dinputd.h> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "base/win/windows_version.h" | 12 #include "base/win/windows_version.h" |
13 #include "content/common/gamepad_hardware_buffer.h" | 13 #include "content/common/gamepad_hardware_buffer.h" |
14 #include "content/common/gamepad_messages.h" | 14 #include "content/common/gamepad_messages.h" |
15 | 15 |
16 // This was removed from the Windows 8 SDK for some reason. | 16 // This was removed from the Windows 8 SDK for some reason. |
17 // We need it so we can get state for axes without worrying if they | 17 // We need it so we can get state for axes without worrying if they |
18 // exist. | 18 // exist. |
19 #ifndef DIDFT_OPTIONAL | 19 #ifndef DIDFT_OPTIONAL |
20 #define DIDFT_OPTIONAL 0x80000000 | 20 #define DIDFT_OPTIONAL 0x80000000 |
21 #endif | 21 #endif |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 using namespace WebKit; | 25 using namespace blink; |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 // See http://goo.gl/5VSJR. These are not available in all versions of the | 29 // See http://goo.gl/5VSJR. These are not available in all versions of the |
30 // header, but they can be returned from the driver, so we define our own | 30 // header, but they can be returned from the driver, so we define our own |
31 // versions here. | 31 // versions here. |
32 static const BYTE kDeviceSubTypeGamepad = 1; | 32 static const BYTE kDeviceSubTypeGamepad = 1; |
33 static const BYTE kDeviceSubTypeWheel = 2; | 33 static const BYTE kDeviceSubTypeWheel = 2; |
34 static const BYTE kDeviceSubTypeArcadeStick = 3; | 34 static const BYTE kDeviceSubTypeArcadeStick = 3; |
35 static const BYTE kDeviceSubTypeFlightStick = 4; | 35 static const BYTE kDeviceSubTypeFlightStick = 4; |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 return false; | 481 return false; |
482 xinput_get_state_ = reinterpret_cast<XInputGetStateFunc>( | 482 xinput_get_state_ = reinterpret_cast<XInputGetStateFunc>( |
483 xinput_dll_.GetFunctionPointer("XInputGetState")); | 483 xinput_dll_.GetFunctionPointer("XInputGetState")); |
484 if (!xinput_get_state_) | 484 if (!xinput_get_state_) |
485 return false; | 485 return false; |
486 xinput_enable_(true); | 486 xinput_enable_(true); |
487 return true; | 487 return true; |
488 } | 488 } |
489 | 489 |
490 } // namespace content | 490 } // namespace content |
OLD | NEW |