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