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 * TODO(xiaoyinh@): Remove this property once we don't support options | |
| 44 */ | |
| 45 hideEnableScreenlock: { | |
|
tommycli
2016/08/17 21:19:59
Instead of adding this Polymer property here for h
xiaoyinh(OOO Sep 11-29)
2016/08/18 22:41:12
Done.
| |
| 46 type: Boolean, | |
| 47 value: false, | |
| 48 notify: true | |
| 49 }, | |
| 50 | |
| 40 }, | 51 }, |
| 41 | 52 |
| 42 /** selectedUnlockType is defined in LockStateBehavior. */ | 53 /** selectedUnlockType is defined in LockStateBehavior. */ |
| 43 observers: ['selectedUnlockTypeChanged_(selectedUnlockType)'], | 54 observers: ['selectedUnlockTypeChanged_(selectedUnlockType)'], |
| 44 | 55 |
| 45 /** @override */ | 56 /** @override */ |
| 46 attached: function() { | 57 attached: function() { |
| 47 // currentRouteChanged is not called during the initial navigation. If the | 58 // currentRouteChanged is not called during the initial navigation. If the |
| 48 // user navigates directly to the lockScreen page, we still want to show the | 59 // user navigates directly to the lockScreen page, we still want to show the |
| 49 // password prompt page. | 60 // password prompt page. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 onSetModesChanged_: function() { | 96 onSetModesChanged_: function() { |
| 86 if (settings.getCurrentRoute() == settings.Route.LOCK_SCREEN && | 97 if (settings.getCurrentRoute() == settings.Route.LOCK_SCREEN && |
| 87 !this.setModes_) { | 98 !this.setModes_) { |
| 88 this.$.setupPin.close(); | 99 this.$.setupPin.close(); |
| 89 this.$.passwordPrompt.open(); | 100 this.$.passwordPrompt.open(); |
| 90 } | 101 } |
| 91 }, | 102 }, |
| 92 | 103 |
| 93 /** @private */ | 104 /** @private */ |
| 94 onPasswordClosed_: function() { | 105 onPasswordClosed_: function() { |
| 95 if (!this.setModes_) | 106 if (!this.setModes_) { |
| 107 /**TODO(xiaoyinh@): Remove this event once we don't support options. */ | |
| 108 this.fire('close-overlay'); | |
|
tommycli
2016/08/17 21:19:59
Likewise, can the embedding code find the inner se
xiaoyinh(OOO Sep 11-29)
2016/08/18 22:41:12
Done.
| |
| 96 settings.navigateTo(settings.Route.PEOPLE); | 109 settings.navigateTo(settings.Route.PEOPLE); |
| 110 } | |
| 97 }, | 111 }, |
| 98 | 112 |
| 99 /** @private */ | 113 /** @private */ |
| 100 onPinSetupDone_: function() { | 114 onPinSetupDone_: function() { |
| 101 this.$.setupPin.close(); | 115 this.$.setupPin.close(); |
| 102 }, | 116 }, |
| 103 | 117 |
| 104 /** | 118 /** |
| 105 * Returns true if the setup pin section should be shown. | 119 * Returns true if the setup pin section should be shown. |
| 106 * @param {!string} selectedUnlockType The current unlock type. Used to let | 120 * @param {!string} selectedUnlockType The current unlock type. Used to let |
| 107 * Polymer know about the dependency. | 121 * Polymer know about the dependency. |
| 108 * @private | 122 * @private |
| 109 */ | 123 */ |
| 110 showConfigurePinButton_: function(selectedUnlockType) { | 124 showConfigurePinButton_: function(selectedUnlockType) { |
| 111 return selectedUnlockType === LockScreenUnlockType.PIN_PASSWORD; | 125 return selectedUnlockType === LockScreenUnlockType.PIN_PASSWORD; |
| 112 }, | 126 }, |
| 113 | 127 |
| 114 /** @private */ | 128 /** @private */ |
| 115 getSetupPinText_: function() { | 129 getSetupPinText_: function() { |
| 116 if (this.hasPin) | 130 if (this.hasPin) |
| 117 return this.i18n('lockScreenChangePinButton'); | 131 return this.i18n('lockScreenChangePinButton'); |
| 118 return this.i18n('lockScreenSetupPinButton'); | 132 return this.i18n('lockScreenSetupPinButton'); |
| 119 }, | 133 }, |
| 120 | 134 |
| 121 /** @private */ | 135 /** @private */ |
| 122 onConfigurePin_: function() { | 136 onConfigurePin_: function() { |
| 123 this.$.setupPin.open(); | 137 this.$.setupPin.open(); |
| 124 }, | 138 }, |
| 125 }); | 139 }); |
| OLD | NEW |