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('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 | 8 |
9 /** | 9 /** |
10 * CertificateImportErrorOverlay class | 10 * CertificateImportErrorOverlay class |
11 * Displays a list of certificates and errors. | 11 * Displays a list of certificates and errors. |
12 * @class | 12 * @class |
13 */ | 13 */ |
14 function CertificateImportErrorOverlay() { | 14 function CertificateImportErrorOverlay() { |
15 OptionsPage.call(this, 'certificateImportErrorOverlay', '', | 15 OptionsPage.call(this, 'certificateImportErrorOverlay', '', |
16 'certificateImportErrorOverlay'); | 16 'certificateImportErrorOverlay'); |
17 } | 17 } |
18 | 18 |
19 cr.addSingletonGetter(CertificateImportErrorOverlay); | 19 cr.addSingletonGetter(CertificateImportErrorOverlay); |
20 | 20 |
21 CertificateImportErrorOverlay.prototype = { | 21 CertificateImportErrorOverlay.prototype = { |
22 // Inherit CertificateImportErrorOverlay from OptionsPage. | 22 // Inherit CertificateImportErrorOverlay from OptionsPage. |
23 __proto__: OptionsPage.prototype, | 23 __proto__: OptionsPage.prototype, |
24 | 24 |
25 /** | 25 /** @override */ |
26 * Initialize the page. | |
27 */ | |
28 initializePage: function() { | 26 initializePage: function() { |
29 // Call base class implementation to start preference initialization. | 27 // Call base class implementation to start preference initialization. |
30 OptionsPage.prototype.initializePage.call(this); | 28 OptionsPage.prototype.initializePage.call(this); |
31 | 29 |
32 $('certificateImportErrorOverlayOk').onclick = function(event) { | 30 $('certificateImportErrorOverlayOk').onclick = function(event) { |
33 OptionsPage.closeOverlay(); | 31 OptionsPage.closeOverlay(); |
34 }; | 32 }; |
35 }, | 33 }, |
36 }; | 34 }; |
37 | 35 |
(...skipping 13 matching lines...) Expand all Loading... |
51 ul.innerHTML = ''; | 49 ul.innerHTML = ''; |
52 for (var i = 0; i < certErrors.length; ++i) { | 50 for (var i = 0; i < certErrors.length; ++i) { |
53 li = document.createElement('li'); | 51 li = document.createElement('li'); |
54 li.textContent = loadTimeData.getStringF('certificateImportErrorFormat', | 52 li.textContent = loadTimeData.getStringF('certificateImportErrorFormat', |
55 certErrors[i].name, | 53 certErrors[i].name, |
56 certErrors[i].error); | 54 certErrors[i].error); |
57 ul.appendChild(li); | 55 ul.appendChild(li); |
58 } | 56 } |
59 | 57 |
60 OptionsPage.navigateToPage('certificateImportErrorOverlay'); | 58 OptionsPage.navigateToPage('certificateImportErrorOverlay'); |
61 } | 59 }; |
62 | 60 |
63 // Export | 61 // Export |
64 return { | 62 return { |
65 CertificateImportErrorOverlay: CertificateImportErrorOverlay | 63 CertificateImportErrorOverlay: CertificateImportErrorOverlay |
66 }; | 64 }; |
67 | 65 |
68 }); | 66 }); |
OLD | NEW |