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

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

Issue 2350253004: Controller support for VrShell (Closed)
Patch Set: Controller support for VrShell Created 4 years, 3 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_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..9b848bb5f6e1eaad61c0f445d7d49f0f374e03e2
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_controller_manager.h
@@ -0,0 +1,56 @@
+// 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 "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);
mthiesse 2016/09/29 14:46:59 ProcessUpdatedContentGesture?
asimjour 2016/09/30 13:37:43 Done.
+
+ // Must be called when the GL renderer gets onDrawFrame().
+ void ProcessUpdatedUIGesture(VrGesture gesture);
+
+ void SetWebContents(content::WebContents* content_wc_ptr,
+ content::WebContents* ui_wc_ptr);
+
+ protected:
+ friend class base::RefCountedThreadSafe<VrControllerManager>;
+ virtual ~VrControllerManager();
+
+ private:
+ void SendGesture(VrGesture gesture, VrInputManager* vr_input_manager);
+
+ VrInputManager* vr_content_ptr_;
+ VrInputManager* vr_ui_ptr_;
+ std::unique_ptr<gvr::ControllerApi> controller_api_;
+
+ DISALLOW_COPY_AND_ASSIGN(VrControllerManager);
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698