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

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

Issue 2536873002: Clean up VR Shell mode transitions (and fix potential webvr startup race). (Closed)
Patch Set: Address comments 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/vr_web_contents_observer.h" 5 #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
6 6
7 #include "chrome/browser/android/vr_shell/ui_interface.h" 7 #include "chrome/browser/android/vr_shell/ui_interface.h"
8 #include "content/public/browser/navigation_handle.h" 8 #include "content/public/browser/navigation_handle.h"
9 9
10 namespace vr_shell { 10 namespace vr_shell {
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 void VrWebContentsObserver::DidFinishNavigation( 41 void VrWebContentsObserver::DidFinishNavigation(
42 content::NavigationHandle* navigation_handle) { 42 content::NavigationHandle* navigation_handle) {
43 ui_interface_->SetURL(navigation_handle->GetURL()); 43 ui_interface_->SetURL(navigation_handle->GetURL());
44 } 44 }
45 45
46 void VrWebContentsObserver::DidToggleFullscreenModeForTab( 46 void VrWebContentsObserver::DidToggleFullscreenModeForTab(
47 bool entered_fullscreen, bool will_cause_resize) { 47 bool entered_fullscreen, bool will_cause_resize) {
48 // TODO(amp): Use will_cause_resize to signal ui of pending size changes. 48 // TODO(amp): Use will_cause_resize to signal ui of pending size changes.
49 int mode = ui_interface_->GetMode(); 49 ui_interface_->SetCinemaMode(entered_fullscreen);
50 if (entered_fullscreen && mode == UiInterface::Mode::STANDARD) {
51 ui_interface_->SetMode(UiInterface::Mode::CINEMA);
52 }
53 if (!entered_fullscreen && mode == UiInterface::Mode::CINEMA) {
54 ui_interface_->SetMode(UiInterface::Mode::STANDARD);
55 }
56 } 50 }
57 51
58 } // namespace vr_shell 52 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.cc ('k') | chrome/browser/resources/vr_shell/vr_shell_ui.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698