Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-lock-screen' allows the user to change how they unlock their | 7 * 'settings-lock-screen' allows the user to change how they unlock their |
| 8 * device. | 8 * device. |
| 9 * | 9 * |
| 10 * Example: | 10 * Example: |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 * entered password. It's defined only when the user has already entered a | 30 * entered password. It's defined only when the user has already entered a |
| 31 * valid password. | 31 * valid password. |
| 32 * | 32 * |
| 33 * @type {Object|undefined} | 33 * @type {Object|undefined} |
| 34 * @private | 34 * @private |
| 35 */ | 35 */ |
| 36 setModes_: { | 36 setModes_: { |
| 37 type: Object, | 37 type: Object, |
| 38 observer: 'onSetModesChanged_' | 38 observer: 'onSetModesChanged_' |
| 39 }, | 39 }, |
| 40 | |
| 41 /** | |
| 42 * Hide enable screenlock settings if coming from options page | |
| 43 */ | |
|
jdufault
2016/08/11 18:34:10
Add a TODO to remove this property after options i
xiaoyinh(OOO Sep 11-29)
2016/08/11 23:59:51
Done.
| |
| 44 hideEnableScreenlock: { | |
| 45 type: Boolean, | |
| 46 value: false, | |
| 47 notify: true | |
| 48 }, | |
| 49 | |
| 40 }, | 50 }, |
| 41 | 51 |
| 42 /** selectedUnlockType is defined in LockStateBehavior. */ | 52 /** selectedUnlockType is defined in LockStateBehavior. */ |
| 43 observers: ['selectedUnlockTypeChanged_(selectedUnlockType)'], | 53 observers: ['selectedUnlockTypeChanged_(selectedUnlockType)'], |
| 44 | 54 |
| 45 /** @override */ | 55 /** @override */ |
| 46 attached: function() { | 56 attached: function() { |
| 47 // currentRouteChanged is not called during the initial navigation. If the | 57 // currentRouteChanged is not called during the initial navigation. If the |
| 48 // user navigates directly to the lockScreen page, we still want to show the | 58 // user navigates directly to the lockScreen page, we still want to show the |
| 49 // password prompt page. | 59 // password prompt page. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 onSetModesChanged_: function() { | 95 onSetModesChanged_: function() { |
| 86 if (settings.getCurrentRoute() == settings.Route.LOCK_SCREEN && | 96 if (settings.getCurrentRoute() == settings.Route.LOCK_SCREEN && |
| 87 !this.setModes_) { | 97 !this.setModes_) { |
| 88 this.$.setupPin.close(); | 98 this.$.setupPin.close(); |
| 89 this.$.passwordPrompt.open(); | 99 this.$.passwordPrompt.open(); |
| 90 } | 100 } |
| 91 }, | 101 }, |
| 92 | 102 |
| 93 /** @private */ | 103 /** @private */ |
| 94 onPasswordClosed_: function() { | 104 onPasswordClosed_: function() { |
| 95 if (!this.setModes_) | 105 if (!this.setModes_) { |
| 106 document.dispatchEvent(new Event('close-overlay')); | |
|
jdufault
2016/08/11 18:34:10
Can you make it work by firing an event on the ele
jdufault
2016/08/11 18:34:11
Add a TODO to remove this event after options is g
xiaoyinh(OOO Sep 11-29)
2016/08/11 23:59:51
Done.
xiaoyinh(OOO Sep 11-29)
2016/08/11 23:59:51
Done.
| |
| 96 settings.navigateTo(settings.Route.PEOPLE); | 107 settings.navigateTo(settings.Route.PEOPLE); |
| 108 } | |
| 97 }, | 109 }, |
| 98 | 110 |
| 99 /** @private */ | 111 /** @private */ |
| 100 onPinSetupDone_: function() { | 112 onPinSetupDone_: function() { |
| 101 this.$.setupPin.close(); | 113 this.$.setupPin.close(); |
| 102 }, | 114 }, |
| 103 | 115 |
| 104 /** | 116 /** |
| 105 * Returns true if the setup pin section should be shown. | 117 * Returns true if the setup pin section should be shown. |
| 106 * @param {!string} selectedUnlockType The current unlock type. Used to let | 118 * @param {!string} selectedUnlockType The current unlock type. Used to let |
| 107 * Polymer know about the dependency. | 119 * Polymer know about the dependency. |
| 108 * @private | 120 * @private |
| 109 */ | 121 */ |
| 110 showConfigurePinButton_: function(selectedUnlockType) { | 122 showConfigurePinButton_: function(selectedUnlockType) { |
| 111 return selectedUnlockType === LockScreenUnlockType.PIN_PASSWORD; | 123 return selectedUnlockType === LockScreenUnlockType.PIN_PASSWORD; |
| 112 }, | 124 }, |
| 113 | 125 |
| 126 /** | |
| 127 * Retruns true if the settings for enable screenlock should be | |
| 128 * hidden, when it is coming from options page | |
| 129 * @private | |
| 130 * */ | |
| 131 hideEnableSettings_: function() { | |
| 132 return this.hideEnableScreenlock; | |
| 133 }, | |
| 134 | |
| 135 | |
| 114 /** @private */ | 136 /** @private */ |
| 115 getSetupPinText_: function() { | 137 getSetupPinText_: function() { |
| 116 if (this.hasPin) | 138 if (this.hasPin) |
| 117 return this.i18n('lockScreenChangePinButton'); | 139 return this.i18n('lockScreenChangePinButton'); |
| 118 return this.i18n('lockScreenSetupPinButton'); | 140 return this.i18n('lockScreenSetupPinButton'); |
| 119 }, | 141 }, |
| 120 | 142 |
| 121 /** @private */ | 143 /** @private */ |
| 122 onConfigurePin_: function() { | 144 onConfigurePin_: function() { |
| 123 this.$.setupPin.open(); | 145 this.$.setupPin.open(); |
| 124 }, | 146 }, |
| 125 }); | 147 }); |
| OLD | NEW |