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 "device/vr/android/gvr/gvr_gamepad_data_fetcher.h" | 5 #include "device/vr/android/gvr/gvr_gamepad_data_fetcher.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "device/gamepad/public/cpp/gamepads.h" | 9 #include "device/gamepad/public/cpp/gamepads.h" |
10 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" | 10 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 GamepadSource GvrGamepadDataFetcher::Factory::source() { | 43 GamepadSource GvrGamepadDataFetcher::Factory::source() { |
44 return GAMEPAD_SOURCE_GVR; | 44 return GAMEPAD_SOURCE_GVR; |
45 } | 45 } |
46 | 46 |
47 GvrGamepadDataFetcher::GvrGamepadDataFetcher( | 47 GvrGamepadDataFetcher::GvrGamepadDataFetcher( |
48 GvrGamepadDataProvider* data_provider, | 48 GvrGamepadDataProvider* data_provider, |
49 unsigned int display_id) | 49 unsigned int display_id) |
50 : display_id_(display_id) { | 50 : display_id_(display_id) { |
51 // Called on UI thread. | 51 // Called on UI thread. |
52 DVLOG(1) << __FUNCTION__ << "=" << this; | 52 DVLOG(1) << __FUNCTION__ << "=" << this; |
53 data_provider->RegisterGamepadDataFetcher(this); | 53 data_provider->RegisterGvrGamepadDataFetcher(this); |
54 } | 54 } |
55 | 55 |
56 GvrGamepadDataFetcher::~GvrGamepadDataFetcher() { | 56 GvrGamepadDataFetcher::~GvrGamepadDataFetcher() { |
57 DVLOG(1) << __FUNCTION__ << "=" << this; | 57 DVLOG(1) << __FUNCTION__ << "=" << this; |
58 } | 58 } |
59 | 59 |
60 GamepadSource GvrGamepadDataFetcher::source() { | 60 GamepadSource GvrGamepadDataFetcher::source() { |
61 return GAMEPAD_SOURCE_GVR; | 61 return GAMEPAD_SOURCE_GVR; |
62 } | 62 } |
63 | 63 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 gfx::Vector3dF gyro = provided_data.gyro; | 134 gfx::Vector3dF gyro = provided_data.gyro; |
135 pad.pose.angular_velocity.not_null = true; | 135 pad.pose.angular_velocity.not_null = true; |
136 pad.pose.angular_velocity.x = gyro.x(); | 136 pad.pose.angular_velocity.x = gyro.x(); |
137 pad.pose.angular_velocity.y = gyro.y(); | 137 pad.pose.angular_velocity.y = gyro.y(); |
138 pad.pose.angular_velocity.z = gyro.z(); | 138 pad.pose.angular_velocity.z = gyro.z(); |
139 } | 139 } |
140 | 140 |
141 void GvrGamepadDataFetcher::PauseHint(bool paused) {} | 141 void GvrGamepadDataFetcher::PauseHint(bool paused) {} |
142 | 142 |
143 } // namespace device | 143 } // namespace device |
OLD | NEW |