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', |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 settings.getCurrentRoute() == settings.routes.IMPORT_DATA; | 156 settings.getCurrentRoute() == settings.routes.IMPORT_DATA; |
157 | 157 |
158 if (settings.getCurrentRoute() == settings.routes.SIGN_OUT) { | 158 if (settings.getCurrentRoute() == settings.routes.SIGN_OUT) { |
159 // If the sync status has not been fetched yet, optimistically display | 159 // If the sync status has not been fetched yet, optimistically display |
160 // the disconnect dialog. There is another check when the sync status is | 160 // the disconnect dialog. There is another check when the sync status is |
161 // fetched. The dialog will be closed then the user is not signed in. | 161 // fetched. The dialog will be closed then the user is not signed in. |
162 if (this.syncStatus && !this.syncStatus.signedIn) { | 162 if (this.syncStatus && !this.syncStatus.signedIn) { |
163 settings.navigateToPreviousRoute(); | 163 settings.navigateToPreviousRoute(); |
164 } else { | 164 } else { |
165 this.showDisconnectDialog_ = true; | 165 this.showDisconnectDialog_ = true; |
166 this.async(function() { | 166 this.async(() => { |
167 this.$$('#disconnectDialog').showModal(); | 167 this.$$('#disconnectDialog').showModal(); |
168 }.bind(this)); | 168 }); |
169 } | 169 } |
170 } else if (this.showDisconnectDialog_) { | 170 } else if (this.showDisconnectDialog_) { |
171 this.$$('#disconnectDialog').close(); | 171 this.$$('#disconnectDialog').close(); |
172 } | 172 } |
173 }, | 173 }, |
174 | 174 |
175 // <if expr="chromeos"> | 175 // <if expr="chromeos"> |
176 /** @private */ | 176 /** @private */ |
177 getPasswordState_: function(hasPin, enableScreenLock) { | 177 getPasswordState_: function(hasPin, enableScreenLock) { |
178 if (!enableScreenLock) | 178 if (!enableScreenLock) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 /** @private */ | 285 /** @private */ |
286 onDisconnectConfirm_: function() { | 286 onDisconnectConfirm_: function() { |
287 var deleteProfile = !!this.syncStatus.domain || this.deleteProfile_; | 287 var deleteProfile = !!this.syncStatus.domain || this.deleteProfile_; |
288 // Trigger the sign out event after the navigateToPreviousRoute(). | 288 // Trigger the sign out event after the navigateToPreviousRoute(). |
289 // So that the navigation to the setting page could be finished before the | 289 // So that the navigation to the setting page could be finished before the |
290 // sign out if navigateToPreviousRoute() returns synchronously even the | 290 // sign out if navigateToPreviousRoute() returns synchronously even the |
291 // browser is closed after the sign out. Otherwise, the navigation will be | 291 // browser is closed after the sign out. Otherwise, the navigation will be |
292 // finshed during session restore if the browser is closed before the async | 292 // finshed during session restore if the browser is closed before the async |
293 // callback executed. | 293 // callback executed. |
294 listenOnce(this, 'signout-dialog-closed', function() { | 294 listenOnce(this, 'signout-dialog-closed', () => { |
295 this.syncBrowserProxy_.signOut(deleteProfile); | 295 this.syncBrowserProxy_.signOut(deleteProfile); |
296 }.bind(this)); | 296 }); |
297 | 297 |
298 this.$$('#disconnectDialog').close(); | 298 this.$$('#disconnectDialog').close(); |
299 }, | 299 }, |
300 | 300 |
301 /** @private */ | 301 /** @private */ |
302 onSyncTap_: function() { | 302 onSyncTap_: function() { |
303 assert(this.syncStatus.signedIn); | 303 assert(this.syncStatus.signedIn); |
304 assert(this.syncStatus.syncSystemEnabled); | 304 assert(this.syncStatus.syncSystemEnabled); |
305 | 305 |
306 if (!this.isSyncStatusActionable_(this.syncStatus)) | 306 if (!this.isSyncStatusActionable_(this.syncStatus)) |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 /** | 464 /** |
465 * @param {!settings.SyncStatus} syncStatus | 465 * @param {!settings.SyncStatus} syncStatus |
466 * @return {boolean} Whether to show the "Sign in to Chrome" button. | 466 * @return {boolean} Whether to show the "Sign in to Chrome" button. |
467 * @private | 467 * @private |
468 */ | 468 */ |
469 showSignin_: function(syncStatus) { | 469 showSignin_: function(syncStatus) { |
470 return !!syncStatus.signinAllowed && !syncStatus.signedIn; | 470 return !!syncStatus.signinAllowed && !syncStatus.signedIn; |
471 }, | 471 }, |
472 }); | 472 }); |
OLD | NEW |