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

Unified Diff: device/vr/vr_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/vr_device.h ('k') | device/vr/vr_display_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_device.cc
diff --git a/device/vr/vr_device.cc b/device/vr/vr_device.cc
index efcd0a393c32728f71f830ef6cc652a129aa8593..59abe735e72a5aae48fc94dcf57035139cfe4ca1 100644
--- a/device/vr/vr_device.cc
+++ b/device/vr/vr_device.cc
@@ -18,7 +18,7 @@ VRDevice::VRDevice() : presenting_service_(nullptr), id_(next_id_) {
VRDevice::~VRDevice() {}
-bool VRDevice::RequestPresent(VRServiceImpl* service, bool secure_origin) {
+bool VRDevice::RequestPresent(bool secure_origin) {
return true;
};
@@ -29,7 +29,8 @@ void VRDevice::AddService(VRServiceImpl* service) {
}
void VRDevice::RemoveService(VRServiceImpl* service) {
- ExitPresent(service);
+ if (IsPresentingService(service))
+ ExitPresent();
displays_.erase(service);
}
@@ -50,10 +51,12 @@ void VRDevice::OnDisplayChanged() {
display.second->client()->OnDisplayChanged(vr_device_info.Clone());
}
-void VRDevice::OnExitPresent(VRServiceImpl* service) {
- DisplayClientMap::iterator it = displays_.find(service);
+void VRDevice::OnExitPresent() {
+ DisplayClientMap::iterator it = displays_.find(presenting_service_);
if (it != displays_.end())
it->second->client()->OnExitPresent();
+
+ SetPresentingService(nullptr);
}
void VRDevice::OnDisplayBlur() {
@@ -66,4 +69,8 @@ void VRDevice::OnDisplayFocus() {
display.second->client()->OnDisplayFocus();
}
+void VRDevice::SetPresentingService(VRServiceImpl* service) {
+ presenting_service_ = service;
+}
+
} // namespace device
« no previous file with comments | « device/vr/vr_device.h ('k') | device/vr/vr_display_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698