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