OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 * EasyUnlockTurnOffOverlay class |
| 11 * Encapsulated handling of the Factory Reset confirmation overlay page. |
| 12 * @class |
| 13 */ |
| 14 function EasyUnlockTurnOffOverlay() { |
| 15 Page.call(this, 'easyUnlockTurnOffOverlay', |
| 16 loadTimeData.getString('easyUnlockTurnOffTitle'), |
| 17 'easy-unlock-turn-off-overlay'); |
| 18 } |
| 19 |
| 20 cr.addSingletonGetter(EasyUnlockTurnOffOverlay); |
| 21 |
| 22 EasyUnlockTurnOffOverlay.prototype = { |
| 23 // Inherit EasyUnlockTurnOffOverlay from Page. |
| 24 __proto__: Page.prototype, |
| 25 |
| 26 /** @override */ |
| 27 initializePage: function() { |
| 28 Page.prototype.initializePage.call(this); |
| 29 |
| 30 $('easy-unlock-turn-off-dismiss').onclick = function(event) { |
| 31 EasyUnlockTurnOffOverlay.dismiss(); |
| 32 }; |
| 33 $('easy-unlock-turn-off-confirm').onclick = function(event) { |
| 34 var clearData = $('easy-unlock-clear-server-data').checked; |
| 35 chrome.send('turnOffEasyUnlock', [clearData]); |
| 36 }; |
| 37 }, |
| 38 }; |
| 39 |
| 40 EasyUnlockTurnOffOverlay.dismiss = function() { |
| 41 PageManager.closeOverlay(); |
| 42 }; |
| 43 |
| 44 // Export |
| 45 return { |
| 46 EasyUnlockTurnOffOverlay: EasyUnlockTurnOffOverlay |
| 47 }; |
| 48 }); |
OLD | NEW |