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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2536223002: Omnibox improvements and fixes. (Closed)
Patch Set: Rebase. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index aa18f3a2518afd75f833e3531995b5aa9b60502a..a408900c313805b5cd37a2063fcdef70d74014ad 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -170,7 +170,8 @@ VrShell::VrShell(JNIEnv* env,
if (for_web_vr)
metrics_helper_->SetWebVREnabled(true);
html_interface_.reset(new UiInterface(
- for_web_vr ? UiInterface::Mode::WEB_VR : UiInterface::Mode::STANDARD));
+ for_web_vr ? UiInterface::Mode::WEB_VR : UiInterface::Mode::STANDARD,
+ main_contents_->IsFullscreen()));
content_compositor_.reset(new VrCompositor(content_window, false));
ui_compositor_.reset(new VrCompositor(ui_window, true));
vr_web_contents_observer_.reset(
@@ -966,7 +967,8 @@ void VrShell::SetWebVrMode(JNIEnv* env,
}
void VrShell::SetWebVRSecureOrigin(bool secure_origin) {
- html_interface_->SetSecureOrigin(secure_origin);
+ // TODO(cjgrant): Align this state with the logic that drives the omnibox.
+ html_interface_->SetWebVRSecureOrigin(secure_origin);
}
void VrShell::SubmitWebVRFrame() {}
@@ -1043,8 +1045,11 @@ void VrShell::DoUiAction(const UiAction action) {
content::NavigationController& controller = main_contents_->GetController();
switch (action) {
case HISTORY_BACK:
- if (controller.CanGoBack())
+ if (main_contents_->IsFullscreen()) {
+ main_contents_->ExitFullscreen(true /* will_cause_resize */);
+ } else if (controller.CanGoBack()) {
controller.GoBack();
+ }
break;
case HISTORY_FORWARD:
if (controller.CanGoForward())
@@ -1056,7 +1061,8 @@ void VrShell::DoUiAction(const UiAction action) {
#if defined(ENABLE_VR_SHELL_UI_DEV)
case RELOAD_UI:
ui_contents_->GetController().Reload(false);
- html_interface_.reset(new UiInterface(UiInterface::Mode::STANDARD));
+ html_interface_.reset(new UiInterface(UiInterface::Mode::STANDARD,
+ main_contents_->IsFullscreen()));
vr_web_contents_observer_->SetUiInterface(html_interface_.get());
break;
#endif

Powered by Google App Engine
This is Rietveld 408576698