Index: chrome/browser/android/vr_shell/vr_controller_manager.h |
diff --git a/chrome/browser/android/vr_shell/vr_controller_manager.h b/chrome/browser/android/vr_shell/vr_controller_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8a2b95c96d550a729373bb947a8adc6d9179bb4f |
--- /dev/null |
+++ b/chrome/browser/android/vr_shell/vr_controller_manager.h |
@@ -0,0 +1,54 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_MANAGER_H_ |
+#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_MANAGER_H_ |
+ |
+#include "base/memory/ref_counted.h" |
+#include "base/task_runner_util.h" |
+#include "chrome/browser/android/vr_shell/vr_controller.h" |
+#include "chrome/browser/android/vr_shell/vr_gesture.h" |
+#include "chrome/browser/android/vr_shell/vr_input_manager.h" |
+#include "content/public/browser/android/content_view_core.h" |
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr.h" |
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_controller.h" |
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_types.h" |
+ |
+namespace vr_shell { |
+ |
+class VrControllerManager |
+ : public base::RefCountedThreadSafe<VrControllerManager> { |
+ public: |
+ // Controller API entry point. |
+ VrControllerManager(); |
+ |
+ // Must be called when the GL renderer gets onSurfaceCreated(). |
+ std::unique_ptr<VrController> InitializeController(gvr_context_* gvr_context); |
+ |
+ // Must be called when the GL renderer gets onDrawFrame(). |
+ VrGesture Update(); |
+ |
+ // Must be called when the GL renderer gets onDrawFrame(). |
+ void ProcessUpdatedGesture(VrGesture gesture); |
bshe
2016/09/22 23:16:49
nit: empty line before comment
asimjour
2016/09/23 16:58:21
Done.
|
+ // Must be called when the GL renderer gets onDrawFrame(). |
+ void ProcessUpdatedUIGesture(VrGesture gesture); |
+ |
+ void SetContentViewCore(content::ContentViewCore* content_cvc_ptr, |
+ content::ContentViewCore* ui_cvc_ptr); |
+ |
+ protected: |
+ friend class base::RefCountedThreadSafe<VrControllerManager>; |
+ virtual ~VrControllerManager(); |
+ |
+ private: |
+ void SendGesture(VrGesture gesture, VrInputManager* content_view_core_ptr); |
+ |
+ VrInputManager* vr_content_ptr; |
bshe
2016/09/22 23:16:49
nit: s/vr_content_ptr/vr_content_ptr_
asimjour
2016/09/23 16:58:21
Done.
|
+ VrInputManager* vr_ui_ptr; |
bshe
2016/09/22 23:16:49
ditto
asimjour
2016/09/23 16:58:21
Done.
|
+ std::unique_ptr<gvr::ControllerApi> controller_api_; |
bshe
2016/09/22 23:16:49
nit: DISALLOW_COPY_AND_ASSIGN
asimjour
2016/09/23 16:58:21
Done.
|
+}; |
+ |
+} // namespace vr_shell |
+ |
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_MANAGER_H_ |