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

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

Issue 2510873003: Clean up WebVR RequestPresent and make callback asynchronous. (Closed)
Patch Set: Fix FakeVRDevice Created 4 years, 1 month 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_shell_delegate.h
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.h b/chrome/browser/android/vr_shell/vr_shell_delegate.h
index ff8b228b928fb8f4447771b82ad3fad3b5b452b6..145c8594def2591ebbb5f8e2abce4d7009c95695 100644
--- a/chrome/browser/android/vr_shell/vr_shell_delegate.h
+++ b/chrome/browser/android/vr_shell/vr_shell_delegate.h
@@ -28,13 +28,12 @@ class VrShellDelegate : public device::GvrDelegateProvider {
base::WeakPtr<device::GvrDeviceProvider> GetDeviceProvider();
- // Called by the Java VrShellDelegate. Returns true if the GvrDeviceProvider
- // needs to handle shutdown first.
- void ExitWebVRIfNecessary(JNIEnv* env, jobject obj);
+ void SetPresentResult(JNIEnv* env, jobject obj, jboolean result);
// device::GvrDelegateProvider implementation
- bool RequestWebVRPresent(
- base::WeakPtr<device::GvrDeviceProvider> device_provider) override;
+ void RequestWebVRPresent(
+ base::WeakPtr<device::GvrDeviceProvider> device_provider,
+ const base::Callback<void(bool)>& callback) override;
void ExitWebVRPresent() override;
base::WeakPtr<device::GvrDelegate> GetNonPresentingDelegate() override;
void DestroyNonPresentingDelegate() override;
@@ -43,6 +42,7 @@ class VrShellDelegate : public device::GvrDelegateProvider {
std::unique_ptr<device::GvrDelegate> non_presenting_delegate_;
base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_;
base::WeakPtr<device::GvrDeviceProvider> device_provider_;
+ base::Callback<void(bool)> present_callback_;
DISALLOW_COPY_AND_ASSIGN(VrShellDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698