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