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 "chrome/browser/android/vr_shell/vr_controller.h" | 5 #include "chrome/browser/android/vr_shell/vr_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "third_party/WebKit/public/web/WebInputEvent.h" | 9 #include "third_party/WebKit/public/web/WebInputEvent.h" |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 bool VrController::IsTouchDown() { | 92 bool VrController::IsTouchDown() { |
93 return controller_state_.GetTouchDown(); | 93 return controller_state_.GetTouchDown(); |
94 } | 94 } |
95 | 95 |
96 bool VrController::IsTouchUp() { | 96 bool VrController::IsTouchUp() { |
97 return controller_state_.GetTouchUp(); | 97 return controller_state_.GetTouchUp(); |
98 } | 98 } |
99 | 99 |
100 bool VrController::IsButtonDown(const int32_t button) { | 100 bool VrController::IsButtonDown(const gvr::ControllerButton button) { |
101 return controller_state_.GetButtonDown(button); | 101 return controller_state_.GetButtonDown(button); |
102 } | 102 } |
103 | 103 |
104 bool VrController::IsButtonUp(const int32_t button) { | 104 bool VrController::IsButtonUp(const gvr::ControllerButton button) { |
105 return controller_state_.GetButtonUp(button); | 105 return controller_state_.GetButtonUp(button); |
106 } | 106 } |
107 | 107 |
108 bool VrController::IsConnected() { | 108 bool VrController::IsConnected() { |
109 return controller_state_.GetConnectionState() == gvr::kControllerConnected; | 109 return controller_state_.GetConnectionState() == gvr::kControllerConnected; |
110 } | 110 } |
111 | 111 |
112 void VrController::UpdateState() { | 112 void VrController::UpdateState() { |
113 const int32_t old_status = controller_state_.GetApiStatus(); | 113 const int32_t old_status = controller_state_.GetApiStatus(); |
114 const int32_t old_connection_state = controller_state_.GetConnectionState(); | 114 const int32_t old_connection_state = controller_state_.GetConnectionState(); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 prev_touch_point_.swap(cur_touch_point_); | 289 prev_touch_point_.swap(cur_touch_point_); |
290 *cur_touch_point_ = touch_info_->touch_point; | 290 *cur_touch_point_ = touch_info_->touch_point; |
291 | 291 |
292 return true; | 292 return true; |
293 } | 293 } |
294 } | 294 } |
295 return false; | 295 return false; |
296 } | 296 } |
297 | 297 |
298 } // namespace vr_shell | 298 } // namespace vr_shell |
OLD | NEW |