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

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

Issue 2872143002: VrShell: Exit fullscreen on app button press. (Closed)
Patch Set: update app button test 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
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/transient_security_warning .h" 10 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning .h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 ConfigureSecurityWarnings(); 217 ConfigureSecurityWarnings();
218 } 218 }
219 219
220 void UiSceneManager::SetWebVrSecureOrigin(bool secure) { 220 void UiSceneManager::SetWebVrSecureOrigin(bool secure) {
221 secure_origin_ = secure; 221 secure_origin_ = secure;
222 ConfigureSecurityWarnings(); 222 ConfigureSecurityWarnings();
223 } 223 }
224 224
225 void UiSceneManager::OnAppButtonClicked() { 225 void UiSceneManager::OnAppButtonClicked() {
226 // App button click exits the WebVR presentation. 226 // App button click exits the WebVR presentation and fullscreen.
227 browser_->ExitPresent(); 227 browser_->ExitPresent();
228 browser_->ExitFullscreen();
228 } 229 }
229 230
230 void UiSceneManager::OnAppButtonGesturePerformed( 231 void UiSceneManager::OnAppButtonGesturePerformed(
231 UiInterface::Direction direction) {} 232 UiInterface::Direction direction) {}
232 233
233 void UiSceneManager::SetFullscreen(bool fullscreen) { 234 void UiSceneManager::SetFullscreen(bool fullscreen) {
234 // Make all VR scene UI elements visible if not in WebVR or fullscreen. 235 // Make all VR scene UI elements visible if not in fullscreen.
235 for (UiElement* element : browser_ui_elements_) { 236 for (UiElement* element : browser_ui_elements_) {
236 element->set_visible(!fullscreen); 237 element->set_visible(!fullscreen);
237 } 238 }
238 239
239 // Show the content quad in full screen. 240 // Show the content quad in full screen.
240 if (fullscreen) { 241 if (fullscreen) {
241 scene_->SetBackgroundColor(kFullscreenBackgroundColor); 242 scene_->SetBackgroundColor(kFullscreenBackgroundColor);
242 main_content_->set_visible(true); 243 main_content_->set_visible(true);
243 main_content_->set_translation( 244 main_content_->set_translation(
244 {0, kFullscreenVerticalOffset, -kFullscreenDistance}); 245 {0, kFullscreenVerticalOffset, -kFullscreenDistance});
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 void UiSceneManager::SetLoadProgress(double progress) {} 292 void UiSceneManager::SetLoadProgress(double progress) {}
292 293
293 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, 294 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back,
294 bool can_go_forward) {} 295 bool can_go_forward) {}
295 296
296 int UiSceneManager::AllocateId() { 297 int UiSceneManager::AllocateId() {
297 return next_available_id_++; 298 return next_available_id_++;
298 } 299 }
299 300
300 } // namespace vr_shell 301 } // namespace vr_shell
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698