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

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell.h

Issue 2384323003: Ensure that the web contents trying to access native VR Shell is the webcontents we created. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/android/jni_weak_ref.h" 12 #include "base/android/jni_weak_ref.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
16 #include "chrome/browser/android/vr_shell/ui_elements.h" 16 #include "chrome/browser/android/vr_shell/ui_elements.h"
17 #include "chrome/browser/android/vr_shell/ui_scene.h" 17 #include "chrome/browser/android/vr_shell/ui_scene.h"
18 #include "device/vr/android/gvr/gvr_delegate.h" 18 #include "device/vr/android/gvr/gvr_delegate.h"
19 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr.h" 19 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr.h"
20 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr_types.h" 20 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr_types.h"
21 21
22 namespace content { 22 namespace content {
23 class ContentViewCore; 23 class ContentViewCore;
24 class WebContents;
24 } 25 }
25 26
26 namespace ui { 27 namespace ui {
27 class WindowAndroid; 28 class WindowAndroid;
28 } 29 }
29 30
30 namespace vr_shell { 31 namespace vr_shell {
31 32
32 class VrCompositor; 33 class VrCompositor;
33 class VrShellDelegate; 34 class VrShellDelegate;
(...skipping 21 matching lines...) Expand all
55 jint content_texture_handle, 56 jint content_texture_handle,
56 jint ui_texture_handle); 57 jint ui_texture_handle);
57 void DrawFrame(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 58 void DrawFrame(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
58 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 59 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
59 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 60 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
60 void SetWebVrMode(JNIEnv* env, 61 void SetWebVrMode(JNIEnv* env,
61 const base::android::JavaParamRef<jobject>& obj, 62 const base::android::JavaParamRef<jobject>& obj,
62 bool enabled); 63 bool enabled);
63 64
64 // html/js UI hooks. 65 // html/js UI hooks.
65 static base::WeakPtr<VrShell> GetWeakPtr(); 66 static base::WeakPtr<VrShell> GetWeakPtr(
67 const content::WebContents* web_contents);
66 UiScene* GetScene(); 68 UiScene* GetScene();
67 void OnDomContentsLoaded(); 69 void OnDomContentsLoaded();
68 void SetUiTextureSize(int width, int height); 70 void SetUiTextureSize(int width, int height);
69 71
70 // device::GvrDelegate implementation 72 // device::GvrDelegate implementation
71 void SetWebVRSecureOrigin(bool secure_origin) override; 73 void SetWebVRSecureOrigin(bool secure_origin) override;
72 void SubmitWebVRFrame() override; 74 void SubmitWebVRFrame() override;
73 void UpdateWebVRTextureBounds( 75 void UpdateWebVRTextureBounds(
74 int eye, float left, float top, float width, float height) override; 76 int eye, float left, float top, float width, float height) override;
75 gvr::GvrApi* gvr_api() override; 77 gvr::GvrApi* gvr_api() override;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 base::WeakPtrFactory<VrShell> weak_ptr_factory_; 154 base::WeakPtrFactory<VrShell> weak_ptr_factory_;
153 155
154 DISALLOW_COPY_AND_ASSIGN(VrShell); 156 DISALLOW_COPY_AND_ASSIGN(VrShell);
155 }; 157 };
156 158
157 bool RegisterVrShell(JNIEnv* env); 159 bool RegisterVrShell(JNIEnv* env);
158 160
159 } // namespace vr_shell 161 } // namespace vr_shell
160 162
161 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 163 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698