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 const OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
7 | 7 |
8 /** | 8 /** |
9 * CertificateRestoreOverlay class | 9 * CertificateRestoreOverlay class |
10 * Encapsulated handling of the 'enter restore password' overlay page. | 10 * Encapsulated handling of the 'enter restore password' overlay page. |
11 * @class | 11 * @class |
12 */ | 12 */ |
13 function CertificateRestoreOverlay() { | 13 function CertificateRestoreOverlay() { |
14 OptionsPage.call(this, 'certificateRestore', | 14 OptionsPage.call(this, 'certificateRestore', '', |
15 '', | |
16 'certificateRestoreOverlay'); | 15 'certificateRestoreOverlay'); |
17 } | 16 } |
18 | 17 |
19 cr.addSingletonGetter(CertificateRestoreOverlay); | 18 cr.addSingletonGetter(CertificateRestoreOverlay); |
20 | 19 |
21 CertificateRestoreOverlay.prototype = { | 20 CertificateRestoreOverlay.prototype = { |
22 __proto__: OptionsPage.prototype, | 21 __proto__: OptionsPage.prototype, |
23 | 22 |
24 /** | 23 /** |
25 * Initializes the page. | 24 * Initializes the page. |
26 */ | 25 */ |
27 initializePage: function() { | 26 initializePage: function() { |
28 OptionsPage.prototype.initializePage.call(this); | 27 OptionsPage.prototype.initializePage.call(this); |
29 | 28 |
30 var self = this; | 29 var self = this; |
31 $('certificateRestoreCancelButton').onclick = function(event) { | 30 $('certificateRestoreCancelButton').onclick = function(event) { |
32 self.cancelRestore_(); | 31 self.cancelRestore_(); |
33 }; | 32 }; |
34 $('certificateRestoreOkButton').onclick = function(event) { | 33 $('certificateRestoreOkButton').onclick = function(event) { |
35 self.finishRestore_(); | 34 self.finishRestore_(); |
36 }; | 35 }; |
37 | 36 |
38 self.clearInputFields_(); | 37 self.clearInputFields_(); |
39 }, | 38 }, |
40 | 39 |
| 40 /** @inheritDoc */ |
| 41 didShowPage: function() { |
| 42 $('certificateRestorePassword').focus(); |
| 43 }, |
| 44 |
41 /** | 45 /** |
42 * Clears any uncommitted input, and dismisses the overlay. | 46 * Clears any uncommitted input, and dismisses the overlay. |
43 * @private | 47 * @private |
44 */ | 48 */ |
45 dismissOverlay_: function() { | 49 dismissOverlay_: function() { |
46 this.clearInputFields_(); | 50 this.clearInputFields_(); |
47 OptionsPage.closeOverlay(); | 51 OptionsPage.closeOverlay(); |
48 }, | 52 }, |
49 | 53 |
50 /** | 54 /** |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 CertificateRestoreOverlay.dismiss = function() { | 92 CertificateRestoreOverlay.dismiss = function() { |
89 CertificateRestoreOverlay.getInstance().dismissOverlay_(); | 93 CertificateRestoreOverlay.getInstance().dismissOverlay_(); |
90 }; | 94 }; |
91 | 95 |
92 // Export | 96 // Export |
93 return { | 97 return { |
94 CertificateRestoreOverlay: CertificateRestoreOverlay | 98 CertificateRestoreOverlay: CertificateRestoreOverlay |
95 }; | 99 }; |
96 | 100 |
97 }); | 101 }); |
OLD | NEW |