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

Unified Diff: device/vr/android/gvr/gvr_device.cc

Issue 2493063004: Fix exiting WebVR via Android UI not fully exiting fullscreen. (Closed)
Patch Set: Rebase pt. 2 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
« no previous file with comments | « device/vr/android/gvr/gvr_device.h ('k') | device/vr/android/gvr/gvr_device_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/android/gvr/gvr_device.cc
diff --git a/device/vr/android/gvr/gvr_device.cc b/device/vr/android/gvr/gvr_device.cc
index fe04d442fb4b813ecc641330ab254e61093ef130..d369134ce13cc602db8e370787c38a792a0a4e3a 100644
--- a/device/vr/android/gvr/gvr_device.cc
+++ b/device/vr/android/gvr/gvr_device.cc
@@ -129,12 +129,9 @@ mojom::VRDisplayInfoPtr GvrDevice::GetVRDevice() {
return device;
}
-mojom::VRPosePtr GvrDevice::GetPose(VRServiceImpl* service) {
+mojom::VRPosePtr GvrDevice::GetPose() {
TRACE_EVENT0("input", "GvrDevice::GetSensorState");
- if (!IsAccessAllowed(service))
- return nullptr;
-
mojom::VRPosePtr pose = mojom::VRPose::New();
pose->timestamp = base::Time::Now().ToJsTime();
@@ -194,10 +191,7 @@ mojom::VRPosePtr GvrDevice::GetPose(VRServiceImpl* service) {
return pose;
}
-void GvrDevice::ResetPose(VRServiceImpl* service) {
- if (!IsAccessAllowed(service))
- return;
-
+void GvrDevice::ResetPose() {
gvr::GvrApi* gvr_api = GetGvrApi();
// Should never call RecenterTracking when using with Daydream viewers. On
@@ -206,15 +200,7 @@ void GvrDevice::ResetPose(VRServiceImpl* service) {
gvr_api->RecenterTracking();
}
-bool GvrDevice::RequestPresent(VRServiceImpl* service, bool secure_origin) {
- if (!IsAccessAllowed(service))
- return false;
-
- // One service could present on several devices at the same time
- // and different service could present on different devices the same time
- if (presenting_service_ == nullptr)
- presenting_service_ = service;
-
+bool GvrDevice::RequestPresent(bool secure_origin) {
secure_origin_ = secure_origin;
if (delegate_)
delegate_->SetWebVRSecureOrigin(secure_origin_);
@@ -222,24 +208,19 @@ bool GvrDevice::RequestPresent(VRServiceImpl* service, bool secure_origin) {
return gvr_provider_->RequestPresent();
}
-void GvrDevice::ExitPresent(VRServiceImpl* service) {
- if (IsPresentingService(service))
- presenting_service_ = nullptr;
-
+void GvrDevice::ExitPresent() {
gvr_provider_->ExitPresent();
- OnExitPresent(service);
+ OnExitPresent();
}
-void GvrDevice::SubmitFrame(VRServiceImpl* service, mojom::VRPosePtr pose) {
- if (!IsPresentingService(service) || !delegate_)
- return;
- delegate_->SubmitWebVRFrame();
+void GvrDevice::SubmitFrame(mojom::VRPosePtr pose) {
+ if (delegate_)
+ delegate_->SubmitWebVRFrame();
}
-void GvrDevice::UpdateLayerBounds(VRServiceImpl* service,
- mojom::VRLayerBoundsPtr leftBounds,
+void GvrDevice::UpdateLayerBounds(mojom::VRLayerBoundsPtr leftBounds,
mojom::VRLayerBoundsPtr rightBounds) {
- if (!IsAccessAllowed(service) || !delegate_)
+ if (!delegate_)
return;
delegate_->UpdateWebVRTextureBounds(0, // Left eye
« no previous file with comments | « device/vr/android/gvr/gvr_device.h ('k') | device/vr/android/gvr/gvr_device_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698