Commit 66c78ad5 authored by kochi@chromium.org's avatar kochi@chromium.org

Fix "Please update your sync passphrase" link on Chrome OS settings.

The link was unconditionally associated with browser restart on Chrome OS,
which made users think the browser crashed.
The action was intended for the case when auth error happened and
needs relogin to refresh the authentication credentials when the message
is "Sign out then sign in again".

For the message "Please update your sync passphrase", don't restart the
browser but just show the dialog to prompt sync passphrase.

Instead of assigning a fixed handler for the element ($(sync-action-link)),
change the action according to whether the message is caused by auth error
or anything else.

BUG=150740
TEST=repro the issue described in 150740, open chrome://settings and click on "Please update your sync passphrase" message.

Review URL: https://codereview.chromium.org/11178004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162319 0039d316-1c4b-4281-b951-d872f2087c98
parent 918091f1
...@@ -86,15 +86,6 @@ cr.define('options', function() { ...@@ -86,15 +86,6 @@ cr.define('options', function() {
// Sync (Sign in) section. // Sync (Sign in) section.
this.updateSyncState_(loadTimeData.getValue('syncData')); this.updateSyncState_(loadTimeData.getValue('syncData'));
$('sync-action-link').onclick = function(event) {
if (cr.isChromeOS) {
// On Chrome OS, sign out the user and sign in again to get fresh
// credentials on auth errors.
SyncSetupOverlay.doSignOutOnAuthError();
} else {
SyncSetupOverlay.showErrorUI();
}
};
$('start-stop-sync').onclick = function(event) { $('start-stop-sync').onclick = function(event) {
if (self.syncSetupCompleted) if (self.syncSetupCompleted)
SyncSetupOverlay.showStopSyncingUI(); SyncSetupOverlay.showStopSyncingUI();
...@@ -650,6 +641,18 @@ cr.define('options', function() { ...@@ -650,6 +641,18 @@ cr.define('options', function() {
$('sync-action-link').hidden = syncData.actionLinkText.length == 0; $('sync-action-link').hidden = syncData.actionLinkText.length == 0;
$('sync-action-link').disabled = syncData.managed; $('sync-action-link').disabled = syncData.managed;
if (cr.isChromeOS && syncData.hasError) {
// On Chrome OS, sign out the user and sign in again to get fresh
// credentials on auth errors.
$('sync-action-link').onclick = function(event) {
SyncSetupOverlay.doSignOutOnAuthError();
};
} else {
$('sync-action-link').onclick = function(event) {
SyncSetupOverlay.showErrorUI();
};
}
if (syncData.hasError) if (syncData.hasError)
$('sync-status').classList.add('sync-error'); $('sync-status').classList.add('sync-error');
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment