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

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

Issue 14691004: [sync] Separate sign in from sync on Desktop Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 months 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 | « chrome/browser/resources/OWNERS ('k') | chrome/browser/resources/sync_setup_overlay.html » ('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 ca19b7952c5e23dbfba83fbe4e08acd98e64f417..5ce8d306b554ee62b4a81deeddeff587df4e4518 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -22,9 +22,7 @@ cr.define('options', function() {
__proto__: options.OptionsPage.prototype,
/**
- * Keeps track of the state of |start-stop-button|. On chrome, the value is
- * true when the user is signed in, and on chromeos, when sync setup has
- * been completed.
+ * Keeps track of whether the user is signed in or not.
* @type {boolean}
* @private
*/
@@ -708,39 +706,44 @@ cr.define('options', function() {
$('sync-section').hidden = false;
- if (cr.isChromeOS)
- this.signedIn_ = syncData.setupCompleted;
- else
- this.signedIn_ = syncData.signedIn;
+ // If the user gets signed out while the advanced sync settings dialog is
+ // visible, say, due to a dashboard clear, close the dialog.
+ if (this.signedIn_ && !syncData.signedIn)
+ SyncSetupOverlay.closeOverlay();
+
+ this.signedIn_ = syncData.signedIn;
- // Display the "setup sync" button if we're signed in and sync is not
- // managed/disabled.
- $('customize-sync').hidden = !this.signedIn_ ||
+ // Display the "advanced settings" button if we're signed in and sync is
+ // not managed/disabled. If the user is signed in, but sync is disabled,
+ // this button is used to re-enable sync.
+ var customizeSyncButton = $('customize-sync');
+ customizeSyncButton.hidden = !this.signedIn_ ||
syncData.managed ||
!syncData.syncSystemEnabled;
-
- var startStopButton = $('start-stop-sync');
- // Disable the "start/stop syncing" button if we're currently signing in,
- // or if we're already signed in and signout is not allowed.
- startStopButton.disabled = syncData.setupInProgress ||
- !syncData.signoutAllowed;
+ customizeSyncButton.textContent = syncData.setupCompleted ?
+ loadTimeData.getString('customizeSync') :
+ loadTimeData.getString('syncButtonTextStart');
+
+ // Disable the "sign in" button if we're currently signing in, or if we're
+ // already signed in and signout is not allowed.
+ var signInButton = $('start-stop-sync');
+ signInButton.disabled = syncData.setupInProgress ||
+ !syncData.signoutAllowed;
if (!syncData.signoutAllowed)
$('start-stop-sync-indicator').setAttribute('controlled-by', 'policy');
else
$('start-stop-sync-indicator').removeAttribute('controlled-by');
- // Hide the "start/stop syncing" button on Chrome OS if sync has already
- // been set up, or if it is managed or disabled.
- startStopButton.hidden = cr.isChromeOS && (syncData.setupCompleted ||
- syncData.isManaged ||
- !syncData.syncSystemEnabled);
- startStopButton.textContent =
+ // Hide the "sign in" button on Chrome OS, and show it on desktop Chrome.
+ signInButton.hidden = cr.isChromeOS;
+
+ signInButton.textContent =
this.signedIn_ ?
loadTimeData.getString('syncButtonTextStop') :
syncData.setupInProgress ?
loadTimeData.getString('syncButtonTextInProgress') :
- loadTimeData.getString('syncButtonTextStart');
- $('start-stop-sync-indicator').hidden = startStopButton.hidden;
+ loadTimeData.getString('syncButtonTextSignIn');
+ $('start-stop-sync-indicator').hidden = signInButton.hidden;
// TODO(estade): can this just be textContent?
$('sync-status-text').innerHTML = syncData.statusText;
@@ -768,7 +771,7 @@ cr.define('options', function() {
else
$('sync-status').classList.remove('sync-error');
- $('customize-sync').disabled = syncData.hasUnrecoverableError;
+ customizeSyncButton.disabled = syncData.hasUnrecoverableError;
// Move #enable-auto-login-checkbox to a different location on CrOS.
if (cr.isChromeOs) {
$('sync-general').insertBefore($('sync-status').nextSibling,
« no previous file with comments | « chrome/browser/resources/OWNERS ('k') | chrome/browser/resources/sync_setup_overlay.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698