| 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 abafd07c8932945c21bf2826c59404f001e9457d..9335b63d19abbbaf4359d78fad4c84cc6a13636f 100644
|
| --- a/chrome/browser/resources/vr_shell/vr_shell_ui.js
|
| +++ b/chrome/browser/resources/vr_shell/vr_shell_ui.js
|
| @@ -236,15 +236,15 @@ var vrShellUi = (function() {
|
| this.updateState();
|
| }
|
|
|
| - setSecureOrigin(secure) {
|
| - this.isSecureOrigin = secure;
|
| + setSecure(secure) {
|
| + this.secure = secure;
|
| this.updateState();
|
| }
|
|
|
| updateState() {
|
| /** @const */ var TRANSIENT_TIMEOUT_MS = 30000;
|
|
|
| - let visible = (this.enabled && !this.isSecureOrigin);
|
| + let visible = (this.enabled && !this.secure);
|
| if (this.secureOriginTimer) {
|
| clearInterval(this.secureOriginTimer);
|
| this.secureOriginTimer = null;
|
| @@ -276,12 +276,10 @@ var vrShellUi = (function() {
|
|
|
| class Omnibox {
|
| constructor(contentQuadId) {
|
| - /** @const */ var VISIBILITY_TIMEOUT_MS = 3000;
|
| -
|
| this.domUiElement = new DomUiElement('#omni-container');
|
| this.enabled = false;
|
| - this.secure = false;
|
| - this.visibilityTimeout = VISIBILITY_TIMEOUT_MS;
|
| + this.level = 0;
|
| + this.visibilityTimeout = 0;
|
| this.visibilityTimer = null;
|
| this.nativeState = {};
|
|
|
| @@ -317,8 +315,8 @@ var vrShellUi = (function() {
|
| this.updateState();
|
| }
|
|
|
| - setSecureOrigin(secure) {
|
| - this.secure = secure;
|
| + setSecurityLevel(level) {
|
| + this.level = level;
|
| this.resetVisibilityTimer();
|
| this.updateState();
|
| }
|
| @@ -356,11 +354,11 @@ var vrShellUi = (function() {
|
| this.setNativeVisibility(false);
|
| return;
|
| }
|
| -
|
| + let secure = this.level == 2 || this.level == 3;
|
| document.querySelector('#omni-secure-icon').style.display =
|
| - (this.secure ? 'block' : 'none');
|
| + (secure ? 'block' : 'none');
|
| document.querySelector('#omni-insecure-icon').style.display =
|
| - (this.secure ? 'none' : 'block');
|
| + (secure ? 'none' : 'block');
|
|
|
| let state = 'idle';
|
| this.visibleAfterTransition = true;
|
| @@ -400,6 +398,8 @@ var vrShellUi = (function() {
|
| }
|
|
|
| setMode(mode) {
|
| + /** @const */ var OMNIBOX_VISIBILITY_TIMEOUT_MS = 5000;
|
| +
|
| this.mode = mode;
|
| this.contentQuad.setEnabled(
|
| mode == api.Mode.STANDARD || mode == api.Mode.CINEMA);
|
| @@ -410,12 +410,18 @@ var vrShellUi = (function() {
|
| mode == api.Mode.STANDARD || mode == api.Mode.CINEMA);
|
| this.omnibox.setEnabled(
|
| mode == api.Mode.STANDARD || mode == api.Mode.CINEMA);
|
| + this.omnibox.setVisibilityTimeout(
|
| + (mode == api.Mode.STANDARD || mode == api.Mode.CINEMA) ?
|
| + 0 : OMNIBOX_VISIBILITY_TIMEOUT_MS);
|
| this.secureOriginWarnings.setEnabled(mode == api.Mode.WEB_VR);
|
| }
|
|
|
| - setSecureOrigin(secure) {
|
| - this.secureOriginWarnings.setSecureOrigin(secure);
|
| - this.omnibox.setSecureOrigin(secure);
|
| + setSecurityLevel(level) {
|
| + this.omnibox.setSecurityLevel(level);
|
| + }
|
| +
|
| + setWebVRSecureOrigin(secure) {
|
| + this.secureOriginWarnings.setSecure(secure);
|
| }
|
|
|
| setReloadUiEnabled(enabled) {
|
| @@ -434,8 +440,11 @@ var vrShellUi = (function() {
|
| if ('mode' in dict) {
|
| sceneManager.setMode(dict['mode']);
|
| }
|
| - if ('secureOrigin' in dict) {
|
| - sceneManager.setSecureOrigin(dict['secureOrigin']);
|
| + if ('securityLevel' in dict) {
|
| + sceneManager.setSecurityLevel(dict['securityLevel']);
|
| + }
|
| + if ('webVRSecureOrigin' in dict) {
|
| + sceneManager.setWebVRSecureOrigin(dict['webVRSecureOrigin']);
|
| }
|
| if ('enableReloadUi' in dict) {
|
| sceneManager.setReloadUiEnabled(dict['enableReloadUi']);
|
|
|