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

Unified Diff: device/vr/android/gvr/gvr_device_provider.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 | « device/vr/android/gvr/gvr_device_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/android/gvr/gvr_device_provider.cc
diff --git a/device/vr/android/gvr/gvr_device_provider.cc b/device/vr/android/gvr/gvr_device_provider.cc
index 5101ba9a8f265ad8e735618337e1322c0512c840..73cc0fc66e61ec4732877687cc58c288500e6d9a 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -14,6 +14,7 @@
#include "device/vr/android/gvr/gvr_device.h"
#include "device/vr/android/gvr/gvr_gamepad_data_fetcher.h"
#include "device/vr/vr_device_manager.h"
+#include "device/vr/vr_service.mojom.h"
#include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr.h"
#include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr_controller.h"
#include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr_types.h"
@@ -49,7 +50,7 @@ void GvrDeviceProvider::Initialize() {
device::GvrDelegateProvider::GetInstance();
if (!delegate_provider)
return;
-
+ delegate_provider->SetDeviceProvider(weak_ptr_factory_.GetWeakPtr());
if (!vr_device_) {
vr_device_.reset(
new GvrDevice(this, delegate_provider->GetNonPresentingDelegate()));
@@ -64,8 +65,7 @@ void GvrDeviceProvider::RequestPresent(
return callback.Run(false);
// RequestWebVRPresent is async as a render thread may be created.
- delegate_provider->RequestWebVRPresent(weak_ptr_factory_.GetWeakPtr(),
- callback);
+ delegate_provider->RequestWebVRPresent(callback);
}
// VR presentation exit requested by the API.
@@ -107,6 +107,12 @@ void GvrDeviceProvider::OnDisplayFocus() {
vr_device_->OnFocus();
}
+void GvrDeviceProvider::OnDisplayActivate() {
+ if (!vr_device_)
+ return;
+ vr_device_->OnActivate(mojom::VRDisplayEventReason::MOUNTED);
+}
+
void GvrDeviceProvider::SwitchToNonPresentingDelegate() {
GvrDelegateProvider* delegate_provider = GvrDelegateProvider::GetInstance();
if (!vr_device_ || !delegate_provider)
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698