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

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene_manager.cc

Issue 2867783002: App button click exits WebVR presentation. (Closed)
Patch Set: Created 3 years, 7 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/ui_scene_manager.h" 5 #include "chrome/browser/android/vr_shell/ui_scene_manager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" 8 #include "chrome/browser/android/vr_shell/textures/ui_texture.h"
9 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning .h" 9 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning .h"
10 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" 10 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 ConfigureSecurityWarnings(); 179 ConfigureSecurityWarnings();
180 } 180 }
181 181
182 void UiSceneManager::SetWebVRSecureOrigin(bool secure) { 182 void UiSceneManager::SetWebVRSecureOrigin(bool secure) {
183 secure_origin_ = secure; 183 secure_origin_ = secure;
184 ConfigureSecurityWarnings(); 184 ConfigureSecurityWarnings();
185 } 185 }
186 186
187 void UiSceneManager::OnAppButtonClicked() { 187 void UiSceneManager::OnAppButtonClicked() {
188 // Pressing the app button currenly pauses content rendering. Note: its still 188 // App button click exits the WebVR presentation.
189 // unclear what we want to do here and this will most likely change. 189 browser_->ExitPresent();
cjgrant 2017/05/08 15:29:40 The UI should know it's presenting WebVR. But I g
amp 2017/05/08 17:48:13 What happens when you press the app button in vr s
tiborg 2017/05/08 18:59:37 cjgrant@: I think it is better to let the delegate
amp 2017/05/08 19:55:22 Yes exiting full screen is what I had in mind. Al
tiborg 2017/05/08 20:14:01 Yeah, exiting fullscreen should be very easy. What
amp 2017/05/08 20:37:02 Follow up cl is fine. We will need to wire up the
190 content_rendering_enabled_ = !content_rendering_enabled_;
191 scene_->SetWebVrRenderingEnabled(content_rendering_enabled_);
192 browser_->OnContentPaused(!content_rendering_enabled_);
193 } 190 }
194 191
195 void UiSceneManager::ConfigureSecurityWarnings() { 192 void UiSceneManager::ConfigureSecurityWarnings() {
196 bool enabled = web_vr_mode_ && !secure_origin_; 193 bool enabled = web_vr_mode_ && !secure_origin_;
197 permanent_security_warning_->set_visible(enabled); 194 permanent_security_warning_->set_visible(enabled);
198 transient_security_warning_->set_visible(enabled); 195 transient_security_warning_->set_visible(enabled);
199 if (enabled) { 196 if (enabled) {
200 security_warning_timer_.Start( 197 security_warning_timer_.Start(
201 FROM_HERE, base::TimeDelta::FromSeconds(kWarningTimeoutSeconds), this, 198 FROM_HERE, base::TimeDelta::FromSeconds(kWarningTimeoutSeconds), this,
202 &UiSceneManager::OnSecurityWarningTimer); 199 &UiSceneManager::OnSecurityWarningTimer);
203 } else { 200 } else {
204 security_warning_timer_.Stop(); 201 security_warning_timer_.Stop();
205 } 202 }
206 } 203 }
207 204
208 void UiSceneManager::OnSecurityWarningTimer() { 205 void UiSceneManager::OnSecurityWarningTimer() {
209 transient_security_warning_->set_visible(false); 206 transient_security_warning_->set_visible(false);
210 } 207 }
211 208
212 int UiSceneManager::AllocateId() { 209 int UiSceneManager::AllocateId() {
213 return next_available_id_++; 210 return next_available_id_++;
214 } 211 }
215 212
216 } // namespace vr_shell 213 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | chrome/browser/android/vr_shell/vr_browser_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698