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

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

Issue 2309523003: Plumbing through more WebVR presentation code (Closed)
Patch Set: Addressed Michael's feedack 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 | « device/vr/android/gvr/gvr_api_manager.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
new file mode 100644
index 0000000000000000000000000000000000000000..e0a4bdf9e28e1be68c5a2b2dce4e5cc36004ac5d
--- /dev/null
+++ b/device/vr/android/gvr/gvr_delegate.h
@@ -0,0 +1,66 @@
+// 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 DEVICE_VR_ANDROID_GVR_DELEGATE_H
+#define DEVICE_VR_ANDROID_GVR_DELEGATE_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 device {
+
+class DEVICE_VR_EXPORT GvrDelegate {
+ public:
+ virtual void RequestWebVRPresent() = 0;
+ virtual void ExitWebVRPresent() = 0;
+
+ virtual void SubmitWebVRFrame() = 0;
+ virtual void UpdateWebVRTextureBounds(int eye,
+ float left,
+ float top,
+ float width,
+ float height) = 0;
+
+ 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 | « device/vr/android/gvr/gvr_api_manager.cc ('k') | device/vr/android/gvr/gvr_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698