| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 * QuickUnlockConfigureOverlay class |
| 11 * Dialog that allows users to configure screen lock. |
| 12 * @constructor |
| 13 * @extends {cr.ui.pageManager.Page} |
| 14 */ |
| 15 function QuickUnlockConfigureOverlay() { |
| 16 Page.call(this, 'quickUnlockConfigureOverlay', |
| 17 loadTimeData.getString('lockScreenTitle'), |
| 18 'quick-unlock-configure-overlay'); |
| 19 |
| 20 } |
| 21 |
| 22 cr.addSingletonGetter(QuickUnlockConfigureOverlay); |
| 23 |
| 24 QuickUnlockConfigureOverlay.prototype = { |
| 25 __proto__: Page.prototype, |
| 26 |
| 27 /** @override */ |
| 28 initializePage: function() { |
| 29 Page.prototype.initializePage.call(this); |
| 30 }, |
| 31 |
| 32 /** @override */ |
| 33 didClosePage: function() { |
| 34 settings.navigateTo(settings.Route.PEOPLE); |
| 35 }, |
| 36 |
| 37 /** @override */ |
| 38 didShowPage: function() { |
| 39 settings.navigateTo(settings.Route.LOCK_SCREEN); |
| 40 var lockScreen = document.querySelector('settings-lock-screen'); |
| 41 |
| 42 var checkbox = lockScreen.root.querySelector('settings-checkbox'); |
| 43 checkbox.hidden = true; |
| 44 |
| 45 var passwordPrompt = lockScreen.root. |
| 46 querySelector('settings-password-prompt-dialog'); |
| 47 passwordPrompt.addEventListener('close', function() { |
| 48 if (!lockScreen.setModes_) { |
| 49 QuickUnlockConfigureOverlay.dismiss(); |
| 50 } |
| 51 }.bind(this)); |
| 52 }, |
| 53 |
| 54 }; |
| 55 |
| 56 QuickUnlockConfigureOverlay.dismiss = function() { |
| 57 PageManager.closeOverlay(); |
| 58 }; |
| 59 |
| 60 // Export |
| 61 return { |
| 62 QuickUnlockConfigureOverlay: QuickUnlockConfigureOverlay |
| 63 }; |
| 64 }); |
| OLD | NEW |