| 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 // Define the default data fetcher that GamepadProvider will use if none is | 5 // Define the default data fetcher that GamepadProvider will use if none is |
| 6 // supplied. (GamepadPlatformDataFetcher). | 6 // supplied. (GamepadPlatformDataFetcher). |
| 7 | 7 |
| 8 #ifndef DEVICE_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_H_ | 8 #ifndef DEVICE_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_H_ |
| 9 #define DEVICE_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_H_ | 9 #define DEVICE_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_H_ |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "device/gamepad/gamepad_data_fetcher.h" | 16 #include "device/gamepad/gamepad_data_fetcher.h" |
| 17 #include "device/gamepad/gamepad_data_fetcher_manager.h" | 17 #include "device/gamepad/gamepad_data_fetcher_manager.h" |
| 18 | 18 |
| 19 #if defined(OS_ANDROID) | 19 #if defined(OS_ANDROID) |
| 20 #include "device/gamepad/gamepad_platform_data_fetcher_android.h" | 20 #include "device/gamepad/gamepad_platform_data_fetcher_android.h" |
| 21 #elif defined(OS_WIN) | 21 #elif defined(OS_WIN) |
| 22 #include "device/gamepad/gamepad_platform_data_fetcher_win.h" | 22 #include "device/gamepad/gamepad_platform_data_fetcher_win.h" |
| 23 #include "device/gamepad/raw_input_data_fetcher_win.h" | 23 #include "device/gamepad/raw_input_data_fetcher_win.h" |
| 24 #elif defined(OS_MACOSX) | 24 #elif defined(OS_MACOSX) |
| 25 #include "device/gamepad/game_controller_data_fetcher_mac.h" |
| 25 #include "device/gamepad/gamepad_platform_data_fetcher_mac.h" | 26 #include "device/gamepad/gamepad_platform_data_fetcher_mac.h" |
| 26 #include "device/gamepad/xbox_data_fetcher_mac.h" | 27 #include "device/gamepad/xbox_data_fetcher_mac.h" |
| 27 #elif defined(OS_LINUX) | 28 #elif defined(OS_LINUX) |
| 28 #include "device/gamepad/gamepad_platform_data_fetcher_linux.h" | 29 #include "device/gamepad/gamepad_platform_data_fetcher_linux.h" |
| 29 #endif | 30 #endif |
| 30 | 31 |
| 31 namespace device { | 32 namespace device { |
| 32 | 33 |
| 33 void AddGamepadPlatformDataFetchers(GamepadDataFetcherManager* manager) { | 34 void AddGamepadPlatformDataFetchers(GamepadDataFetcherManager* manager) { |
| 34 #if defined(OS_ANDROID) | 35 #if defined(OS_ANDROID) |
| 35 | 36 |
| 36 manager->AddFactory(new GamepadPlatformDataFetcherAndroid::Factory()); | 37 manager->AddFactory(new GamepadPlatformDataFetcherAndroid::Factory()); |
| 37 | 38 |
| 38 #elif defined(OS_WIN) | 39 #elif defined(OS_WIN) |
| 39 | 40 |
| 40 manager->AddFactory(new GamepadPlatformDataFetcherWin::Factory()); | 41 manager->AddFactory(new GamepadPlatformDataFetcherWin::Factory()); |
| 41 manager->AddFactory(new RawInputDataFetcher::Factory()); | 42 manager->AddFactory(new RawInputDataFetcher::Factory()); |
| 42 | 43 |
| 43 #elif defined(OS_MACOSX) | 44 #elif defined(OS_MACOSX) |
| 44 | 45 |
| 46 manager->AddFactory(new GameControllerDataFetcherMac::Factory()); |
| 45 manager->AddFactory(new GamepadPlatformDataFetcherMac::Factory()); | 47 manager->AddFactory(new GamepadPlatformDataFetcherMac::Factory()); |
| 46 manager->AddFactory(new XboxDataFetcher::Factory()); | 48 manager->AddFactory(new XboxDataFetcher::Factory()); |
| 47 | 49 |
| 48 #elif defined(OS_LINUX) && defined(USE_UDEV) | 50 #elif defined(OS_LINUX) && defined(USE_UDEV) |
| 49 | 51 |
| 50 manager->AddFactory(new GamepadPlatformDataFetcherLinux::Factory()); | 52 manager->AddFactory(new GamepadPlatformDataFetcherLinux::Factory()); |
| 51 | 53 |
| 52 #endif | 54 #endif |
| 53 } | 55 } |
| 54 | 56 |
| 55 } // namespace device | 57 } // namespace device |
| 56 | 58 |
| 57 #endif // DEVICE_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_H_ | 59 #endif // DEVICE_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_H_ |
| OLD | NEW |