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

Unified Diff: chrome/browser/resources/vr_shell/vr_shell_ui.js

Issue 2557743006: Fix omnibox security icons. (Closed)
Patch Set: Add warning icon support. 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
« no previous file with comments | « chrome/browser/resources/vr_shell/vr_shell_ui.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c3595e2937d770d03ec65e46954810de33754679..3c8b7c8213cbb7858663b0615d6b49af7b2cdf66 100644
--- a/chrome/browser/resources/vr_shell/vr_shell_ui.js
+++ b/chrome/browser/resources/vr_shell/vr_shell_ui.js
@@ -288,6 +288,23 @@ var vrShellUi = (function() {
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
+ return '#omni-info-icon';
+ case 2: // SECURE:
+ case 3: // EV_SECURE:
+ return '#omni-lock-icon';
+ case 5: // SECURE_WITH_POLICY_INSTALLED_CERT (ChromeOS only)
+ case 6: // DANGEROUS
+ default:
+ return '#omni-warning-icon';
+ }
+ }
+
setEnabled(enabled) {
this.enabled = enabled;
this.resetVisibilityTimer();
@@ -347,11 +364,12 @@ var vrShellUi = (function() {
this.setNativeVisibility(false);
return;
}
- let secure = this.level == 2 || this.level == 3;
- document.querySelector('#omni-secure-icon').style.display =
- (secure ? 'block' : 'none');
- document.querySelector('#omni-insecure-icon').style.display =
- (secure ? 'none' : 'block');
+
+ document.querySelector('#omni-warning-icon').style.display = 'none';
+ document.querySelector('#omni-info-icon').style.display = 'none';
+ document.querySelector('#omni-lock-icon').style.display = 'none';
+ let icon = this.getSecurityIconElementId(this.level);
+ document.querySelector(icon).style.display = 'block';
let state = 'idle';
this.visibleAfterTransition = true;
« no previous file with comments | « chrome/browser/resources/vr_shell/vr_shell_ui.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698