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

Unified Diff: device/vr/android/gvr/gvr_delegate.h

Issue 2343023002: Switch WebVR to handle GvrApi management through VrShellDelegate (Closed)
Patch Set: Renamed onNativeLibraryReady to initializeNative 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
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_delegate.cc ('k') | device/vr/android/gvr/gvr_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/android/gvr/gvr_delegate.h
diff --git a/device/vr/android/gvr/gvr_delegate.h b/device/vr/android/gvr/gvr_delegate.h
index e0a4bdf9e28e1be68c5a2b2dce4e5cc36004ac5d..27c827451ba7ccc924cbff421552194b80f3f742 100644
--- a/device/vr/android/gvr/gvr_delegate.h
+++ b/device/vr/android/gvr/gvr_delegate.h
@@ -5,22 +5,29 @@
#ifndef DEVICE_VR_ANDROID_GVR_DELEGATE_H
#define DEVICE_VR_ANDROID_GVR_DELEGATE_H
+#include "device/vr/android/gvr/gvr_device_provider.h"
#include "device/vr/vr_export.h"
-#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr.h"
-
-namespace base {
-template <typename Type>
-struct DefaultSingletonTraits;
-} // namespace base
+namespace gvr {
+class GvrApi;
+} // namespace gvr
namespace device {
-class DEVICE_VR_EXPORT GvrDelegate {
+class DEVICE_VR_EXPORT GvrDelegateProvider {
public:
- virtual void RequestWebVRPresent() = 0;
+ static void SetInstance(GvrDelegateProvider* delegate_provider);
+ static GvrDelegateProvider* GetInstance();
+
+ virtual bool RequestWebVRPresent(GvrDeviceProvider* device_provider) = 0;
virtual void ExitWebVRPresent() = 0;
+ private:
+ static GvrDelegateProvider* delegate_provider_;
+};
+
+class DEVICE_VR_EXPORT GvrDelegate {
+ public:
virtual void SubmitWebVRFrame() = 0;
virtual void UpdateWebVRTextureBounds(int eye,
float left,
@@ -31,36 +38,6 @@ class DEVICE_VR_EXPORT GvrDelegate {
virtual gvr::GvrApi* gvr_api() = 0;
};
-class DEVICE_VR_EXPORT GvrDelegateClient {
- public:
- virtual void OnDelegateInitialized(GvrDelegate* delegate) = 0;
- virtual void OnDelegateShutdown() = 0;
-};
-
-class DEVICE_VR_EXPORT GvrDelegateManager {
- public:
- static GvrDelegateManager* GetInstance();
-
- void AddClient(GvrDelegateClient* client);
- void RemoveClient(GvrDelegateClient* client);
-
- void Initialize(GvrDelegate* delegate);
- void Shutdown();
-
- GvrDelegate* delegate() { return delegate_; }
-
- private:
- friend struct base::DefaultSingletonTraits<GvrDelegateManager>;
-
- GvrDelegateManager();
- ~GvrDelegateManager();
-
- GvrDelegate* delegate_;
-
- using ClientList = std::vector<GvrDelegateClient*>;
- ClientList clients_;
-};
-
} // namespace device
#endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_delegate.cc ('k') | device/vr/android/gvr/gvr_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698