OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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-people-page' is the settings page containing sign-in settings. | 7 * 'settings-people-page' is the settings page containing sign-in settings. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-people-page', | 10 is: 'settings-people-page', |
11 | 11 |
12 behaviors: [ | 12 behaviors: [ |
| 13 settings.RouteObserverBehavior, |
13 I18nBehavior, | 14 I18nBehavior, |
14 WebUIListenerBehavior, | 15 WebUIListenerBehavior, |
15 <if expr="chromeos"> | 16 <if expr="chromeos"> |
16 LockStateBehavior, | 17 LockStateBehavior, |
17 </if> | 18 </if> |
18 ], | 19 ], |
19 | 20 |
20 properties: { | 21 properties: { |
21 /** | 22 /** |
22 * Preferences state. | 23 * Preferences state. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (this.easyUnlockAllowed_) { | 133 if (this.easyUnlockAllowed_) { |
133 this.addWebUIListener( | 134 this.addWebUIListener( |
134 'easy-unlock-enabled-status', | 135 'easy-unlock-enabled-status', |
135 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); | 136 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); |
136 this.easyUnlockBrowserProxy_.getEnabledStatus().then( | 137 this.easyUnlockBrowserProxy_.getEnabledStatus().then( |
137 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); | 138 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); |
138 } | 139 } |
139 </if> | 140 </if> |
140 }, | 141 }, |
141 | 142 |
| 143 /** @protected */ |
| 144 currentRouteChanged: function() { |
| 145 if (settings.getCurrentRoute() == settings.Route.SIGN_OUT) |
| 146 this.$.disconnectDialog.showModal(); |
| 147 else if (this.$.disconnectDialog.open) |
| 148 this.$.disconnectDialog.close(); |
| 149 }, |
| 150 |
142 <if expr="chromeos"> | 151 <if expr="chromeos"> |
143 /** @private */ | 152 /** @private */ |
144 getPasswordState_: function(hasPin, enableScreenLock) { | 153 getPasswordState_: function(hasPin, enableScreenLock) { |
145 if (!enableScreenLock) | 154 if (!enableScreenLock) |
146 return this.i18n('lockScreenNone'); | 155 return this.i18n('lockScreenNone'); |
147 if (hasPin) | 156 if (hasPin) |
148 return this.i18n('lockScreenPinOrPassword'); | 157 return this.i18n('lockScreenPinOrPassword'); |
149 return this.i18n('lockScreenPasswordOnly'); | 158 return this.i18n('lockScreenPasswordOnly'); |
150 }, | 159 }, |
151 </if> | 160 </if> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 onActivityControlsTap_: function() { | 218 onActivityControlsTap_: function() { |
210 this.syncBrowserProxy_.openActivityControlsUrl(); | 219 this.syncBrowserProxy_.openActivityControlsUrl(); |
211 }, | 220 }, |
212 | 221 |
213 /** @private */ | 222 /** @private */ |
214 onSigninTap_: function() { | 223 onSigninTap_: function() { |
215 this.syncBrowserProxy_.startSignIn(); | 224 this.syncBrowserProxy_.startSignIn(); |
216 }, | 225 }, |
217 | 226 |
218 /** @private */ | 227 /** @private */ |
| 228 onDisconnectClosed_: function() { |
| 229 if (settings.getCurrentRoute() == settings.Route.SIGN_OUT) |
| 230 settings.navigateToPreviousRoute(); |
| 231 }, |
| 232 |
| 233 /** @private */ |
219 onDisconnectTap_: function() { | 234 onDisconnectTap_: function() { |
220 this.$.disconnectDialog.showModal(); | 235 settings.navigateTo(settings.Route.SIGN_OUT); |
221 }, | 236 }, |
222 | 237 |
223 /** @private */ | 238 /** @private */ |
224 onDisconnectCancel_: function() { | 239 onDisconnectCancel_: function() { |
225 this.$.disconnectDialog.close(); | 240 this.$.disconnectDialog.close(); |
226 }, | 241 }, |
227 | 242 |
228 /** @private */ | 243 /** @private */ |
229 onDisconnectConfirm_: function() { | 244 onDisconnectConfirm_: function() { |
230 var deleteProfile = !!this.syncStatus.domain || | 245 var deleteProfile = !!this.syncStatus.domain || |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 349 |
335 /** | 350 /** |
336 * @param {string} iconUrl | 351 * @param {string} iconUrl |
337 * @return {string} A CSS imageset for multiple scale factors. | 352 * @return {string} A CSS imageset for multiple scale factors. |
338 * @private | 353 * @private |
339 */ | 354 */ |
340 getIconImageset_: function(iconUrl) { | 355 getIconImageset_: function(iconUrl) { |
341 return cr.icon.getProfileAvatarIcon(iconUrl); | 356 return cr.icon.getProfileAvatarIcon(iconUrl); |
342 }, | 357 }, |
343 }); | 358 }); |
OLD | NEW |