| 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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" |
| 12 #include "chrome/browser/android/vr_shell/vr_controller_model.h" | 13 #include "chrome/browser/android/vr_shell/vr_controller_model.h" |
| 13 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" | 14 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" |
| 14 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/
gvr_types.h" | 15 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/
gvr_types.h" |
| 15 #include "ui/gfx/geometry/point3_f.h" | 16 #include "ui/gfx/geometry/point3_f.h" |
| 16 #include "ui/gfx/geometry/quaternion.h" | 17 #include "ui/gfx/geometry/quaternion.h" |
| 17 #include "ui/gfx/geometry/vector2d_f.h" | 18 #include "ui/gfx/geometry/vector2d_f.h" |
| 18 #include "ui/gfx/geometry/vector3d_f.h" | 19 #include "ui/gfx/geometry/vector3d_f.h" |
| 19 | 20 |
| 20 namespace blink { | 21 namespace blink { |
| 21 class WebGestureEvent; | 22 class WebGestureEvent; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 bool TouchDownHappened(); | 74 bool TouchDownHappened(); |
| 74 | 75 |
| 75 bool TouchUpHappened(); | 76 bool TouchUpHappened(); |
| 76 | 77 |
| 77 bool ButtonUpHappened(gvr::ControllerButton button); | 78 bool ButtonUpHappened(gvr::ControllerButton button); |
| 78 bool ButtonDownHappened(gvr::ControllerButton button); | 79 bool ButtonDownHappened(gvr::ControllerButton button); |
| 79 bool ButtonState(gvr::ControllerButton button) const; | 80 bool ButtonState(gvr::ControllerButton button) const; |
| 80 | 81 |
| 81 bool IsConnected(); | 82 bool IsConnected(); |
| 82 | 83 |
| 84 base::TimeTicks GetLastOrientationTimestamp() const; |
| 85 base::TimeTicks GetLastTouchTimestamp() const; |
| 86 base::TimeTicks GetLastButtonTimestamp() const; |
| 87 |
| 83 private: | 88 private: |
| 84 enum GestureDetectorState { | 89 enum GestureDetectorState { |
| 85 WAITING, // waiting for user to touch down | 90 WAITING, // waiting for user to touch down |
| 86 TOUCHING, // touching the touch pad but not scrolling | 91 TOUCHING, // touching the touch pad but not scrolling |
| 87 SCROLLING // scrolling on the touch pad | 92 SCROLLING // scrolling on the touch pad |
| 88 }; | 93 }; |
| 89 | 94 |
| 90 struct TouchPoint { | 95 struct TouchPoint { |
| 91 gfx::Vector2dF position; | 96 gfx::Vector2dF position; |
| 92 int64_t timestamp; | 97 int64_t timestamp; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 int extrapolated_touch_ = 0; | 189 int extrapolated_touch_ = 0; |
| 185 | 190 |
| 186 std::unique_ptr<ElbowModel> elbow_model_; | 191 std::unique_ptr<ElbowModel> elbow_model_; |
| 187 | 192 |
| 188 DISALLOW_COPY_AND_ASSIGN(VrController); | 193 DISALLOW_COPY_AND_ASSIGN(VrController); |
| 189 }; | 194 }; |
| 190 | 195 |
| 191 } // namespace vr_shell | 196 } // namespace vr_shell |
| 192 | 197 |
| 193 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ | 198 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ |
| OLD | NEW |