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

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

Issue 2878543002: Refactor VR Shell Input. Locks input to click/scroll targets. (Closed)
Patch Set: Created 3 years, 7 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
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 7f6693e80911a731b1d852d1deed946ee55b0b02..25b5fc15658df4d7d0344f5868f5653da037324b 100644
--- a/chrome/browser/android/vr_shell/vr_controller.h
+++ b/chrome/browser/android/vr_shell/vr_controller.h
@@ -12,12 +12,11 @@
#include "chrome/browser/android/vr_shell/vr_controller_model.h"
#include "device/vr/android/gvr/gvr_gamepad_data_provider.h"
#include "device/vr/vr_types.h"
-#include "third_party/WebKit/public/platform/WebGestureEvent.h"
-#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h"
-using blink::WebGestureEvent;
-using blink::WebInputEvent;
+namespace blink {
+class WebGestureEvent;
+}
namespace gvr {
class ControllerState;
@@ -30,6 +29,8 @@ class ElbowModel;
// Angle (radians) the beam down from the controller axis, for wrist comfort.
constexpr float kErgoAngleOffset = 0.26f;
+using GestureList = std::vector<std::unique_ptr<blink::WebGestureEvent>>;
+
class VrController {
public:
// Controller API entry point.
@@ -47,7 +48,7 @@ class VrController {
// Must be called when the GL renderer gets OnDrawFrame().
void UpdateState(const gfx::Vector3dF& head_direction);
- std::vector<std::unique_ptr<WebGestureEvent>> DetectGestures();
+ std::unique_ptr<GestureList> DetectGestures();
bool IsTouching();
@@ -99,18 +100,18 @@ class VrController {
int64_t timestamp;
};
- void UpdateGestureFromTouchInfo(WebGestureEvent* gesture);
+ void UpdateGestureFromTouchInfo(blink::WebGestureEvent* gesture);
bool GetButtonLongPressFromButtonInfo();
// Handle the waiting state.
- void HandleWaitingState(WebGestureEvent* gesture);
+ void HandleWaitingState(blink::WebGestureEvent* gesture);
// Handle the detecting state.
- void HandleDetectingState(WebGestureEvent* gesture);
+ void HandleDetectingState(blink::WebGestureEvent* gesture);
// Handle the scrolling state.
- void HandleScrollingState(WebGestureEvent* gesture);
+ void HandleScrollingState(blink::WebGestureEvent* gesture);
void UpdateTouchInfo();
// Returns true if the touch position is within the slop of the initial touch

Powered by Google App Engine
This is Rietveld 408576698