| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 /** @private */ | 293 /** @private */ |
| 294 onSyncTap_: function() { | 294 onSyncTap_: function() { |
| 295 assert(this.syncStatus.signedIn); | 295 assert(this.syncStatus.signedIn); |
| 296 assert(this.syncStatus.syncSystemEnabled); | 296 assert(this.syncStatus.syncSystemEnabled); |
| 297 | 297 |
| 298 if (!this.isSyncStatusActionable_(this.syncStatus)) | 298 if (!this.isSyncStatusActionable_(this.syncStatus)) |
| 299 return; | 299 return; |
| 300 | 300 |
| 301 switch (this.syncStatus.statusAction) { | 301 switch (this.syncStatus.statusAction) { |
| 302 case settings.StatusAction.REAUTHENTICATE: | 302 case settings.StatusAction.REAUTHENTICATE: |
| 303 this.syncBrowserProxy_.startSignIn(); |
| 304 break; |
| 305 case settings.StatusAction.SIGNOUT_AND_SIGNIN: |
| 303 <if expr="chromeos"> | 306 <if expr="chromeos"> |
| 304 this.syncBrowserProxy_.attemptUserExit(); | 307 this.syncBrowserProxy_.attemptUserExit(); |
| 305 </if> | 308 </if> |
| 306 <if expr="not chromeos"> | 309 <if expr="not chromeos"> |
| 307 if (this.syncStatus.domain) | 310 if (this.syncStatus.domain) |
| 308 settings.navigateTo(settings.Route.SIGN_OUT); | 311 settings.navigateTo(settings.Route.SIGN_OUT); |
| 309 else { | 312 else { |
| 310 // Silently sign the user out without deleting their profile and | 313 // Silently sign the user out without deleting their profile and |
| 311 // prompt them to sign back in. | 314 // prompt them to sign back in. |
| 312 this.syncBrowserProxy_.signOut(false); | 315 this.syncBrowserProxy_.signOut(false); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 470 |
| 468 /** | 471 /** |
| 469 * @param {!settings.SyncStatus} syncStatus | 472 * @param {!settings.SyncStatus} syncStatus |
| 470 * @return {boolean} Whether to show the "Sign in to Chrome" button. | 473 * @return {boolean} Whether to show the "Sign in to Chrome" button. |
| 471 * @private | 474 * @private |
| 472 */ | 475 */ |
| 473 showSignin_: function(syncStatus) { | 476 showSignin_: function(syncStatus) { |
| 474 return !!syncStatus.signinAllowed && !syncStatus.signedIn; | 477 return !!syncStatus.signinAllowed && !syncStatus.signedIn; |
| 475 }, | 478 }, |
| 476 }); | 479 }); |
| OLD | NEW |