| 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 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 // Returns true if the touch position is within the slop of the initial touch | 103 // Returns true if the touch position is within the slop of the initial touch |
| 104 // point, false otherwise. | 104 // point, false otherwise. |
| 105 bool InSlop(const gvr::Vec2f touch_position); | 105 bool InSlop(const gvr::Vec2f touch_position); |
| 106 | 106 |
| 107 // Returns true if the gesture is in horizontal direction. | 107 // Returns true if the gesture is in horizontal direction. |
| 108 bool IsHorizontalGesture(); | 108 bool IsHorizontalGesture(); |
| 109 | 109 |
| 110 void Reset(); | 110 void Reset(); |
| 111 | 111 |
| 112 // Update gesture parameters, | 112 void UpdateGestureParameters(); |
| 113 void UpdateGesture(WebGestureEvent* gesture); | |
| 114 | 113 |
| 115 // If the user is touching the touch pad and the touch point is different from | 114 // If the user is touching the touch pad and the touch point is different from |
| 116 // before, update the touch point and return true. Otherwise, return false. | 115 // before, update the touch point and return true. Otherwise, return false. |
| 117 bool UpdateCurrentTouchpoint(); | 116 bool UpdateCurrentTouchpoint(); |
| 118 | 117 |
| 119 void UpdateOverallVelocity(); | 118 void UpdateOverallVelocity(); |
| 120 | 119 |
| 121 // State of gesture detector. | 120 // State of gesture detector. |
| 122 GestureDetectorState state_; | 121 GestureDetectorState state_; |
| 123 | 122 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 156 |
| 158 // Number of consecutively extrapolated touch points | 157 // Number of consecutively extrapolated touch points |
| 159 int extrapolated_touch_ = 0; | 158 int extrapolated_touch_ = 0; |
| 160 | 159 |
| 161 DISALLOW_COPY_AND_ASSIGN(VrController); | 160 DISALLOW_COPY_AND_ASSIGN(VrController); |
| 162 }; | 161 }; |
| 163 | 162 |
| 164 } // namespace vr_shell | 163 } // namespace vr_shell |
| 165 | 164 |
| 166 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ | 165 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ |
| OLD | NEW |