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

Unified Diff: chrome/browser/android/vr_shell/vr_controller.h

Issue 2380323003: Refactorings to vr controller code. (Closed)
Patch Set: Fix BUILD.gn Created 4 years, 2 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 | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/vr_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_controller.h
diff --git a/chrome/browser/android/vr_shell/vr_controller.h b/chrome/browser/android/vr_shell/vr_controller.h
index 7291d5b067ac1e87e7bd1b356b0535e0e54b599a..f5e9a4774b4f2ca98f268a944eb672164635f38b 100644
--- a/chrome/browser/android/vr_shell/vr_controller.h
+++ b/chrome/browser/android/vr_shell/vr_controller.h
@@ -30,7 +30,7 @@ class VrController {
// Must be called when the GL renderer gets OnDrawFrame().
void UpdateState();
- VrGesture DetectGesture();
+ std::unique_ptr<VrGesture> DetectGesture();
bool IsTouching();
@@ -76,7 +76,7 @@ class VrController {
int64_t timestamp;
};
- void UpdateGestureFromTouchInfo();
+ void UpdateGestureFromTouchInfo(VrGesture* gesture);
bool GetButtonLongPressFromButtonInfo();
@@ -84,16 +84,11 @@ class VrController {
void HandleWaitingState();
// Handle the detecting state.
- void HandleDetectingState();
+ void HandleDetectingState(VrGesture* gesture);
// Handle the scrolling state.
- void HandleScrollingState();
- void Update(const gvr_controller_state* controller_state);
- void Update(bool touch_up,
- bool touch_down,
- bool is_touching,
- const gvr::Vec2f position,
- int64_t timestamp);
+ void HandleScrollingState(VrGesture* gesture);
+ void UpdateTouchInfo();
// Returns true if the touch position is within the slop of the initial touch
// point, false otherwise.
@@ -101,10 +96,6 @@ class VrController {
void Reset();
- size_t GetGestureListSize() { return gesture_list_.size(); }
-
- const VrGesture* GetGesturePtr(const size_t index);
-
// Update gesture parameters,
void UpdateGesture(VrGesture* gesture);
@@ -124,7 +115,6 @@ class VrController {
bool pinch_started_;
bool zoom_in_progress_ = false;
- std::vector<VrGesture> gesture_list_;
std::unique_ptr<TouchInfo> touch_info_;
// A pointer storing the touch point from previous frame.
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/vr_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698