| Index: chrome/browser/resources/vr_shell/vr_shell_ui.js
|
| diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui.js b/chrome/browser/resources/vr_shell/vr_shell_ui.js
|
| index cde460d6b9878d67bdd72fd03a6e882dbd3046d5..3cb3d389b47e3975591d6762a006bf1bf33200af 100644
|
| --- a/chrome/browser/resources/vr_shell/vr_shell_ui.js
|
| +++ b/chrome/browser/resources/vr_shell/vr_shell_ui.js
|
| @@ -573,27 +573,37 @@ var vrShellUi = (function() {
|
| this.reloadUiButton = new ReloadUiButton();
|
| }
|
|
|
| - setMode(mode, menuMode, fullscreen) {
|
| - /** @const */ var URL_INDICATOR_VISIBILITY_TIMEOUT_MS = 5000;
|
| -
|
| + setMode(mode, fullscreen) {
|
| this.mode = mode;
|
| - this.menuMode = menuMode;
|
| this.fullscreen = fullscreen;
|
| + this.updateState();
|
| + }
|
| +
|
| + handleAppButtonClicked() {
|
| + this.menuMode = !this.menuMode;
|
| + this.updateState();
|
| + }
|
| +
|
| + updateState() {
|
| + /** @const */ var URL_INDICATOR_VISIBILITY_TIMEOUT_MS = 5000;
|
| +
|
| + let mode = this.mode;
|
| + let menuMode = this.menuMode;
|
| +
|
| + api.doAction(api.Action.SET_CONTENT_PAUSED, {'paused': menuMode});
|
|
|
| - this.reloadUiButton.setEnabled(mode == api.Mode.STANDARD);
|
| this.contentQuad.setEnabled(mode == api.Mode.STANDARD && !menuMode);
|
| - this.contentQuad.setFullscreen(fullscreen);
|
| + this.contentQuad.setFullscreen(this.fullscreen);
|
| // TODO(crbug/643815): Set aspect ratio on content quad when available.
|
| - // TODO(amp): Don't show controls in fullscreen once MENU mode lands.
|
| - this.controls.setEnabled(mode == api.Mode.STANDARD && !menuMode);
|
| + this.controls.setEnabled(menuMode);
|
| + this.omnibox.setEnabled(menuMode);
|
| this.urlIndicator.setEnabled(mode == api.Mode.STANDARD && !menuMode);
|
| - // TODO(amp): Don't show controls in CINEMA mode once MENU mode lands.
|
| this.urlIndicator.setVisibilityTimeout(
|
| - mode == api.Mode.STANDARD && !menuMode ?
|
| - 0 :
|
| - URL_INDICATOR_VISIBILITY_TIMEOUT_MS);
|
| - this.omnibox.setEnabled(false);
|
| - this.secureOriginWarnings.setEnabled(mode == api.Mode.WEB_VR);
|
| + URL_INDICATOR_VISIBILITY_TIMEOUT_MS);
|
| + this.secureOriginWarnings.setEnabled(
|
| + mode == api.Mode.WEB_VR && !menuMode);
|
| +
|
| + this.reloadUiButton.setEnabled(mode == api.Mode.STANDARD);
|
|
|
| api.setUiCssSize(
|
| uiRootElement.clientWidth, uiRootElement.clientHeight, UI_DPR);
|
| @@ -617,7 +627,10 @@ var vrShellUi = (function() {
|
|
|
| function command(dict) {
|
| if ('mode' in dict) {
|
| - uiManager.setMode(dict['mode'], dict['menuMode'], dict['fullscreen']);
|
| + uiManager.setMode(dict['mode'], dict['fullscreen']);
|
| + }
|
| + if ('appButtonClicked' in dict) {
|
| + uiManager.handleAppButtonClicked();
|
| }
|
| if ('securityLevel' in dict) {
|
| uiManager.setSecurityLevel(dict['securityLevel']);
|
|
|