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 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 | 7 |
8 /** | 8 /** |
9 * FactoryResetOverlay class | 9 * FactoryResetOverlay class |
10 * Encapsulated handling of the Factory Reset confirmation overlay page. | 10 * Encapsulated handling of the Factory Reset confirmation overlay page. |
11 * @class | 11 * @class |
12 */ | 12 */ |
13 function FactoryResetOverlay() { | 13 function FactoryResetOverlay() { |
14 OptionsPage.call(this, 'factoryResetData', | 14 OptionsPage.call(this, 'factoryResetData', |
15 loadTimeData.getString('factoryResetTitle'), | 15 loadTimeData.getString('factoryResetTitle'), |
16 'factory-reset-overlay'); | 16 'factory-reset-overlay'); |
17 } | 17 } |
18 | 18 |
19 cr.addSingletonGetter(FactoryResetOverlay); | 19 cr.addSingletonGetter(FactoryResetOverlay); |
20 | 20 |
21 FactoryResetOverlay.prototype = { | 21 FactoryResetOverlay.prototype = { |
22 // Inherit FactoryResetOverlay from OptionsPage. | 22 // Inherit FactoryResetOverlay 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 starts preference initialization. | 27 // Call base class implementation to starts preference initialization. |
30 OptionsPage.prototype.initializePage.call(this); | 28 OptionsPage.prototype.initializePage.call(this); |
31 | 29 |
32 $('factory-reset-data-dismiss').onclick = function(event) { | 30 $('factory-reset-data-dismiss').onclick = function(event) { |
33 FactoryResetOverlay.dismiss(); | 31 FactoryResetOverlay.dismiss(); |
34 }; | 32 }; |
35 $('factory-reset-data-restart').onclick = function(event) { | 33 $('factory-reset-data-restart').onclick = function(event) { |
36 chrome.send('performFactoryResetRestart'); | 34 chrome.send('performFactoryResetRestart'); |
37 }; | 35 }; |
38 }, | 36 }, |
39 }; | 37 }; |
40 | 38 |
41 FactoryResetOverlay.dismiss = function() { | 39 FactoryResetOverlay.dismiss = function() { |
42 OptionsPage.closeOverlay(); | 40 OptionsPage.closeOverlay(); |
43 }; | 41 }; |
44 | 42 |
45 // Export | 43 // Export |
46 return { | 44 return { |
47 FactoryResetOverlay: FactoryResetOverlay | 45 FactoryResetOverlay: FactoryResetOverlay |
48 }; | 46 }; |
49 }); | 47 }); |
OLD | NEW |