| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/exo/gamepad.h" | 5 #include "components/exo/gamepad.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 SchedulePollOnPollingThread(); | 134 SchedulePollOnPollingThread(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 // Callback to ProcessGamepadChanges using weak reference to Gamepad. | 137 // Callback to ProcessGamepadChanges using weak reference to Gamepad. |
| 138 ProcessGamepadChangesCallback process_gamepad_changes_; | 138 ProcessGamepadChangesCallback process_gamepad_changes_; |
| 139 | 139 |
| 140 // Callback method to create a gamepad data fetcher. | 140 // Callback method to create a gamepad data fetcher. |
| 141 CreateGamepadDataFetcherCallback create_fetcher_callback_; | 141 CreateGamepadDataFetcherCallback create_fetcher_callback_; |
| 142 | 142 |
| 143 // Reference to task runner on polling thread. | 143 // Reference to task runner on polling thread. |
| 144 base::SingleThreadTaskRunner* polling_task_runner_; | 144 scoped_refptr<base::SingleThreadTaskRunner> polling_task_runner_; |
| 145 | 145 |
| 146 // Reference to task runner on origin thread. | 146 // Reference to task runner on origin thread. |
| 147 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; | 147 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; |
| 148 | 148 |
| 149 // Gamepad data fetcher used for querying gamepad devices. | 149 // Gamepad data fetcher used for querying gamepad devices. |
| 150 std::unique_ptr<device::GamepadDataFetcher> fetcher_; | 150 std::unique_ptr<device::GamepadDataFetcher> fetcher_; |
| 151 | 151 |
| 152 // The current state of all gamepads. | 152 // The current state of all gamepads. |
| 153 blink::WebGamepads state_; | 153 blink::WebGamepads state_; |
| 154 | 154 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 delegate_->OnButton(button_id, new_button.pressed, new_button.value); | 256 delegate_->OnButton(button_id, new_button.pressed, new_button.value); |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 if (send_frame) | 259 if (send_frame) |
| 260 delegate_->OnFrame(); | 260 delegate_->OnFrame(); |
| 261 | 261 |
| 262 pad_state_ = new_pad; | 262 pad_state_ = new_pad; |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace exo | 265 } // namespace exo |
| OLD | NEW |