Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var vrShellUi = (function() { | 5 var vrShellUi = (function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 let scene = new ui.Scene(); | 8 let scene = new ui.Scene(); |
| 9 let sceneManager; | 9 let sceneManager; |
| 10 | 10 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 if (e.propertyName == 'opacity' && !this.visibleAfterTransition) { | 340 if (e.propertyName == 'opacity' && !this.visibleAfterTransition) { |
| 341 this.setNativeVisibility(false); | 341 this.setNativeVisibility(false); |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 | 344 |
| 345 updateState() { | 345 updateState() { |
| 346 if (!this.enabled) { | 346 if (!this.enabled) { |
| 347 this.setNativeVisibility(false); | 347 this.setNativeVisibility(false); |
| 348 return; | 348 return; |
| 349 } | 349 } |
| 350 let secure = this.level == 2 || this.level == 3; | 350 |
| 351 document.querySelector('#omni-secure-icon').style.display = | 351 // See security_state.h and getSecurityIconResource() for this mapping. |
| 352 (secure ? 'block' : 'none'); | 352 let image = 'warning.svg'; |
| 353 document.querySelector('#omni-insecure-icon').style.display = | 353 switch (this.level) { |
| 354 (secure ? 'none' : 'block'); | 354 case 0: // NONE |
| 355 case 1: // HTTP_SHOW_WARNING | |
| 356 case 4: // SECURITY_WARNING | |
| 357 image = 'info.svg'; | |
| 358 break; | |
| 359 case 2: // SECURE: | |
| 360 case 3: // EV_SECURE: | |
| 361 image = 'lock.svg'; | |
| 362 break; | |
| 363 case 5: // SECURE_WITH_POLICY_INSTALLED_CERT | |
| 364 // TODO(cjgrant): Clank appears to not handle this case. | |
|
cjgrant
2016/12/05 20:28:36
I'm investigating this, and will list a bug if war
cjgrant
2016/12/06 15:52:00
Done (not a bug, only ChromeOS uses '5')
| |
| 365 break; | |
| 366 case 6: // DANGEROUS: | |
|
mthiesse
2016/12/05 20:57:30
no dangerous icon? Saving that for later?
cjgrant
2016/12/05 22:10:17
It would use the warning image from line 352, but
cjgrant
2016/12/06 15:52:00
Done.
| |
| 367 default: | |
| 368 break; | |
| 369 } | |
| 370 document.querySelector('#omni-icon').src = 'images/' + image; | |
| 355 | 371 |
| 356 let state = 'idle'; | 372 let state = 'idle'; |
| 357 this.visibleAfterTransition = true; | 373 this.visibleAfterTransition = true; |
| 358 if (this.loading) { | 374 if (this.loading) { |
| 359 state = 'loading'; | 375 state = 'loading'; |
| 360 } else if (this.visibilityTimeout > 0 && !this.visibilityTimer) { | 376 } else if (this.visibilityTimeout > 0 && !this.visibilityTimer) { |
| 361 state = 'hide'; | 377 state = 'hide'; |
| 362 this.visibleAfterTransition = false; | 378 this.visibleAfterTransition = false; |
| 363 } | 379 } |
| 364 document.querySelector('#omni').className = state; | 380 document.querySelector('#omni').className = state; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 458 scene.flush(); | 474 scene.flush(); |
| 459 } | 475 } |
| 460 | 476 |
| 461 return { | 477 return { |
| 462 initialize: initialize, | 478 initialize: initialize, |
| 463 command: command, | 479 command: command, |
| 464 }; | 480 }; |
| 465 })(); | 481 })(); |
| 466 | 482 |
| 467 document.addEventListener('DOMContentLoaded', vrShellUi.initialize); | 483 document.addEventListener('DOMContentLoaded', vrShellUi.initialize); |
| OLD | NEW |