Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3020)

Unified Diff: device/gamepad/gamepad_service.cc

Issue 2808093006: [Device Service] Move Gamepad Blink headers to be part of the Gamepad client library (Closed)
Patch Set: rebase and address comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/gamepad/gamepad_service.h ('k') | device/gamepad/gamepad_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/gamepad/gamepad_service.cc
diff --git a/device/gamepad/gamepad_service.cc b/device/gamepad/gamepad_service.cc
index 2fd5354dc24d53543ddabbf20db3d2f8e6a5c064..3335b256473e3e71b5d088b022a216ea36ac17a0 100644
--- a/device/gamepad/gamepad_service.cc
+++ b/device/gamepad/gamepad_service.cc
@@ -108,7 +108,7 @@ void GamepadService::Terminate() {
void GamepadService::OnGamepadConnectionChange(bool connected,
int index,
- const blink::WebGamepad& pad) {
+ const Gamepad& pad) {
if (connected) {
main_thread_task_runner_->PostTask(
FROM_HERE, base::Bind(&GamepadService::OnGamepadConnected,
@@ -120,8 +120,7 @@ void GamepadService::OnGamepadConnectionChange(bool connected,
}
}
-void GamepadService::OnGamepadConnected(int index,
- const blink::WebGamepad& pad) {
+void GamepadService::OnGamepadConnected(int index, const Gamepad& pad) {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
for (ConsumerSet::iterator it = consumers_.begin(); it != consumers_.end();
@@ -131,8 +130,7 @@ void GamepadService::OnGamepadConnected(int index,
}
}
-void GamepadService::OnGamepadDisconnected(int index,
- const blink::WebGamepad& pad) {
+void GamepadService::OnGamepadDisconnected(int index, const Gamepad& pad) {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
for (ConsumerSet::iterator it = consumers_.begin(); it != consumers_.end();
@@ -166,10 +164,10 @@ void GamepadService::OnUserGesture() {
if (!it->did_observe_user_gesture && it->is_active) {
const ConsumerInfo& info = *it;
info.did_observe_user_gesture = true;
- blink::WebGamepads gamepads;
+ Gamepads gamepads;
provider_->GetCurrentGamepadData(&gamepads);
- for (unsigned i = 0; i < blink::WebGamepads::kItemsLengthCap; ++i) {
- const blink::WebGamepad& pad = gamepads.items[i];
+ for (unsigned i = 0; i < Gamepads::kItemsLengthCap; ++i) {
+ const Gamepad& pad = gamepads.items[i];
if (pad.connected)
info.consumer->OnGamepadConnected(i, pad);
}
« no previous file with comments | « device/gamepad/gamepad_service.h ('k') | device/gamepad/gamepad_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698