| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('cert_viewer', function() { | 5 cr.define('cert_viewer', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Initialize the certificate viewer dialog by wiring up the close button, | 9 * Initialize the certificate viewer dialog by wiring up the close button, |
| 10 * substituting in translated strings and requesting certificate details. | 10 * substituting in translated strings and requesting certificate details. |
| 11 */ | 11 */ |
| 12 function initialize() { | 12 function initialize() { |
| 13 cr.ui.decorate('tabbox', cr.ui.TabBox); | 13 cr.ui.decorate('tabbox', cr.ui.TabBox); |
| 14 | 14 |
| 15 i18nTemplate.process(document, templateData); | 15 i18nTemplate.process(document, templateData); |
| 16 | 16 |
| 17 var args = JSON.parse(chrome.dialogArguments); | 17 var args = JSON.parse(chrome.getVariableValue('dialogArguments')); |
| 18 getCertificateInfo(args); | 18 getCertificateInfo(args); |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * Initialize the second tab's contents. | 21 * Initialize the second tab's contents. |
| 22 * This is a 'oneShot' function, meaning it will only be invoked once, | 22 * This is a 'oneShot' function, meaning it will only be invoked once, |
| 23 * no matter how many times it is called. This is done for unit-testing | 23 * no matter how many times it is called. This is done for unit-testing |
| 24 * purposes in case a test needs to initialize the tab before the timer | 24 * purposes in case a test needs to initialize the tab before the timer |
| 25 * fires. | 25 * fires. |
| 26 */ | 26 */ |
| 27 var initializeDetailTab = oneShot(function() { | 27 var initializeDetailTab = oneShot(function() { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 chrome.send('exportCertificate', [item.detail.payload.index]); | 204 chrome.send('exportCertificate', [item.detail.payload.index]); |
| 205 } | 205 } |
| 206 | 206 |
| 207 return { | 207 return { |
| 208 initialize: initialize, | 208 initialize: initialize, |
| 209 getCertificateFields: getCertificateFields, | 209 getCertificateFields: getCertificateFields, |
| 210 }; | 210 }; |
| 211 }); | 211 }); |
| 212 | 212 |
| 213 document.addEventListener('DOMContentLoaded', cert_viewer.initialize); | 213 document.addEventListener('DOMContentLoaded', cert_viewer.initialize); |
| OLD | NEW |