Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2798)

Unified Diff: chrome/browser/resources/options/browser_options.js

Issue 2492293002: [MD Settings][Options] Fixes bugs with the sync status messages/actions (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/options/sync_setup_overlay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index bcce79b0825f894363abb9b24c07fce1a802130e..587bfcde6d8744bcedbec73e65f01f63ad30da96 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -16,6 +16,7 @@ cr.exportPath('options');
* signedIn: (boolean|undefined),
* signinAllowed: (boolean|undefined),
* signoutAllowed: (boolean|undefined),
+ * statusAction: (string|undefined),
* statusText: (string|undefined),
* supervisedUser: (boolean|undefined),
* syncSystemEnabled: (boolean|undefined)}}
@@ -1213,13 +1214,31 @@ cr.define('options', function() {
$('sync-action-link').disabled = syncData.managed ||
!syncData.syncSystemEnabled;
- // On Chrome OS, sign out the user and sign in again to get fresh
- // credentials on auth errors.
$('sync-action-link').onclick = function(event) {
- if (cr.isChromeOS && syncData.hasError)
- SyncSetupOverlay.doSignOutOnAuthError();
- else
- SyncSetupOverlay.showSetupUI();
+ switch (syncData.statusAction) {
+ case 'reauthenticate':
+<if expr="chromeos">
+ // On Chrome OS, sign out the user and sign in again to get fresh
+ // credentials on auth errors.
+ SyncSetupOverlay.doSignOutOnAuthError();
+</if>
+<if expr="not chromeos">
+ if (syncData.signoutAllowed) {
+ // Silently sign the user out without deleting their profile and
+ // prompt them to sign back in.
+ chrome.send('SyncSetupStopSyncing', [false /* deleteProfile */]);
+ SyncSetupOverlay.startSignIn(false /* creatingSupervisedUser */);
+ } else {
+ chrome.send('showDisconnectManagedProfileDialog');
+ }
+</if>
+ break;
+ case 'upgradeClient':
+ PageManager.showPageByName('help');
+ break;
+ default:
+ SyncSetupOverlay.showSetupUI();
+ }
};
if (syncData.hasError)
« no previous file with comments | « no previous file | chrome/browser/resources/options/sync_setup_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698