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

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

Issue 2538053003: Implement vrdisplayactivate for GVR DON. (Closed)
Patch Set: Created 4 years 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.h ('k') | device/vr/android/gvr/gvr_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell_delegate.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.cc b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
index 1f98c8b817debc1718710abb49d8f62f43a91582..d7779a200728ea51394eecb97c42a29e7a1a134a 100644
--- a/chrome/browser/android/vr_shell/vr_shell_delegate.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
@@ -70,8 +70,18 @@ void VrShellDelegate::SetPresentResult(JNIEnv* env, jobject obj,
present_callback_.Reset();
}
+void VrShellDelegate::DisplayActivate(JNIEnv* env, jobject obj) {
+ if (device_provider_) {
+ device_provider_->OnDisplayActivate();
+ }
+}
+
+void VrShellDelegate::SetDeviceProvider(
+ base::WeakPtr<device::GvrDeviceProvider> device_provider) {
+ device_provider_ = device_provider;
+}
+
void VrShellDelegate::RequestWebVRPresent(
- base::WeakPtr<device::GvrDeviceProvider> device_provider,
const base::Callback<void(bool)>& callback) {
if (!present_callback_.is_null()) {
// Can only handle one request at a time. This is also extremely unlikely to
@@ -80,9 +90,6 @@ void VrShellDelegate::RequestWebVRPresent(
return;
}
- // TODO(mthiesse): Clean this up, there's no reason to be setting the device
- // provider from RequestWebVRPresent.
- device_provider_ = device_provider;
present_callback_ = std::move(callback);
// If/When VRShell is ready for use it will call SetPresentResult.
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_delegate.h ('k') | device/vr/android/gvr/gvr_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698