| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |