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 3c8b7c8213cbb7858663b0615d6b49af7b2cdf66..32936fdd97d23a915fdb4080fb59bdf774640f9c 100644 |
--- a/chrome/browser/resources/vr_shell/vr_shell_ui.js |
+++ b/chrome/browser/resources/vr_shell/vr_shell_ui.js |
@@ -77,8 +77,7 @@ var vrShellUi = (function() { |
// Pull additional custom properties from CSS. |
let style = window.getComputedStyle(domElement); |
element.setTranslation( |
- getStyleFloat(style, '--tranX'), |
- getStyleFloat(style, '--tranY'), |
+ getStyleFloat(style, '--tranX'), getStyleFloat(style, '--tranY'), |
getStyleFloat(style, '--tranZ')); |
this.uiElementId = scene.addElement(element); |
@@ -124,15 +123,24 @@ var vrShellUi = (function() { |
constructor(contentQuadId) { |
this.buttons = []; |
let descriptors = [ |
- ['#back', function() { |
+ [ |
+ '#back', |
+ function() { |
api.doAction(api.Action.HISTORY_BACK); |
- }], |
- ['#reload', function() { |
+ } |
+ ], |
+ [ |
+ '#reload', |
+ function() { |
api.doAction(api.Action.RELOAD); |
- }], |
- ['#forward', function() { |
+ } |
+ ], |
+ [ |
+ '#forward', |
+ function() { |
api.doAction(api.Action.HISTORY_FORWARD); |
- }], |
+ } |
+ ], |
]; |
/** @const */ var BUTTON_SPACING = 0.136; |
@@ -203,8 +211,8 @@ var vrShellUi = (function() { |
this.webVrSecureWarning = new DomUiElement('#webvr-not-secure-permanent'); |
let update = new api.UiElementUpdate(); |
update.setScale(DISTANCE, DISTANCE, 1); |
- update.setTranslation(0, DISTANCE * Math.sin(ANGLE_UP), |
- -DISTANCE * Math.cos(ANGLE_UP)); |
+ update.setTranslation( |
+ 0, DISTANCE * Math.sin(ANGLE_UP), -DISTANCE * Math.cos(ANGLE_UP)); |
update.setRotation(1.0, 0.0, 0.0, ANGLE_UP); |
update.setHitTestable(false); |
update.setVisible(false); |
@@ -213,8 +221,7 @@ var vrShellUi = (function() { |
// Temporary WebVR security warning. This warning is shown in the center |
// of the field of view, for a limited period of time. |
- this.transientWarning = new DomUiElement( |
- '#webvr-not-secure-transient'); |
+ this.transientWarning = new DomUiElement('#webvr-not-secure-transient'); |
update = new api.UiElementUpdate(); |
update.setScale(DISTANCE, DISTANCE, 1); |
update.setTranslation(0, 0, -DISTANCE); |
@@ -243,8 +250,8 @@ var vrShellUi = (function() { |
this.secureOriginTimer = null; |
} |
if (visible) { |
- this.secureOriginTimer = setTimeout( |
- this.onTransientTimer.bind(this), TRANSIENT_TIMEOUT_MS); |
+ this.secureOriginTimer = |
+ setTimeout(this.onTransientTimer.bind(this), TRANSIENT_TIMEOUT_MS); |
} |
this.showOrHideWarnings(visible); |
} |
@@ -284,22 +291,22 @@ var vrShellUi = (function() { |
// Listen to the end of transitions, so that the box can be natively |
// hidden after it finishes hiding itself. |
- document.querySelector('#omni').addEventListener('transitionend', |
- this.onAnimationDone.bind(this)); |
+ document.querySelector('#omni').addEventListener( |
+ 'transitionend', this.onAnimationDone.bind(this)); |
} |
getSecurityIconElementId(level) { |
// See security_state.h and getSecurityIconResource() for this mapping. |
switch (level) { |
- case 0: // NONE |
- case 1: // HTTP_SHOW_WARNING |
- case 4: // SECURITY_WARNING |
+ case 0: // NONE |
+ case 1: // HTTP_SHOW_WARNING |
+ case 4: // SECURITY_WARNING |
return '#omni-info-icon'; |
- case 2: // SECURE: |
- case 3: // EV_SECURE: |
+ case 2: // SECURE: |
+ case 3: // EV_SECURE: |
return '#omni-lock-icon'; |
- case 5: // SECURE_WITH_POLICY_INSTALLED_CERT (ChromeOS only) |
- case 6: // DANGEROUS |
+ case 5: // SECURE_WITH_POLICY_INSTALLED_CERT (ChromeOS only) |
+ case 6: // DANGEROUS |
default: |
return '#omni-warning-icon'; |
} |
@@ -344,7 +351,7 @@ var vrShellUi = (function() { |
} |
if (this.enabled && this.visibilityTimeout > 0 && !this.loading) { |
this.visibilityTimer = setTimeout( |
- this.onVisibilityTimer.bind(this), this.visibilityTimeout); |
+ this.onVisibilityTimer.bind(this), this.visibilityTimeout); |
} |
} |
@@ -426,11 +433,12 @@ var vrShellUi = (function() { |
// TODO(amp): Don't show controls in CINEMA mode once MENU mode lands. |
this.omnibox.setVisibilityTimeout( |
mode == api.Mode.STANDARD && !menuMode ? |
- 0 : OMNIBOX_VISIBILITY_TIMEOUT_MS); |
+ 0 : |
mthiesse
2016/12/23 05:30:59
nit: does style guide require the else clause to b
dschuyler
2016/12/27 19:38:10
I recall a discussion about putting ? and : at the
dschuyler
2016/12/28 19:26:22
Ah Dan points out that there was a vote on this to
cjgrant
2017/01/04 18:24:12
I've run clang-format on the vr_shell files as par
|
+ OMNIBOX_VISIBILITY_TIMEOUT_MS); |
this.secureOriginWarnings.setEnabled(mode == api.Mode.WEB_VR); |
- api.setUiCssSize(uiRootElement.clientWidth, uiRootElement.clientHeight, |
- UI_DPR); |
+ api.setUiCssSize( |
+ uiRootElement.clientWidth, uiRootElement.clientHeight, UI_DPR); |
} |
setSecurityLevel(level) { |