Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_MANAGER_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_MANAGER_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/task_runner_util.h" | |
| 10 #include "chrome/browser/android/vr_shell/vr_controller.h" | |
| 11 #include "chrome/browser/android/vr_shell/vr_gesture.h" | |
| 12 #include "chrome/browser/android/vr_shell/vr_input_manager.h" | |
| 13 #include "content/public/browser/android/content_view_core.h" | |
| 14 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr.h" | |
| 15 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr_controller.h" | |
| 16 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr_types.h" | |
| 17 | |
| 18 namespace vr_shell { | |
| 19 | |
| 20 class VrControllerManager | |
| 21 : public base::RefCountedThreadSafe<VrControllerManager> { | |
| 22 public: | |
| 23 // Controller API entry point. | |
| 24 VrControllerManager(); | |
| 25 | |
| 26 // Must be called when the GL renderer gets onSurfaceCreated(). | |
| 27 std::unique_ptr<VrController> InitializeController(gvr_context_* gvr_context); | |
| 28 | |
| 29 // Must be called when the GL renderer gets onDrawFrame(). | |
| 30 VrGesture Update(); | |
| 31 | |
| 32 // Must be called when the GL renderer gets onDrawFrame(). | |
| 33 void ProcessUpdatedGesture(VrGesture gesture); | |
|
bshe
2016/09/22 23:16:49
nit: empty line before comment
asimjour
2016/09/23 16:58:21
Done.
| |
| 34 // Must be called when the GL renderer gets onDrawFrame(). | |
| 35 void ProcessUpdatedUIGesture(VrGesture gesture); | |
| 36 | |
| 37 void SetContentViewCore(content::ContentViewCore* content_cvc_ptr, | |
| 38 content::ContentViewCore* ui_cvc_ptr); | |
| 39 | |
| 40 protected: | |
| 41 friend class base::RefCountedThreadSafe<VrControllerManager>; | |
| 42 virtual ~VrControllerManager(); | |
| 43 | |
| 44 private: | |
| 45 void SendGesture(VrGesture gesture, VrInputManager* content_view_core_ptr); | |
| 46 | |
| 47 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.
| |
| 48 VrInputManager* vr_ui_ptr; | |
|
bshe
2016/09/22 23:16:49
ditto
asimjour
2016/09/23 16:58:21
Done.
| |
| 49 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.
| |
| 50 }; | |
| 51 | |
| 52 } // namespace vr_shell | |
| 53 | |
| 54 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_MANAGER_H_ | |
| OLD | NEW |