summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-29 01:55:21 +0000
committerrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-29 01:55:21 +0000
commit588ad3c98ab23f0f0945d14fefd594fccdec38b7 (patch)
tree9cfee07ac100f572e53e57cdf5e8895eeaecac95
parent9b4cd1b5eff9385649c0f4eb781f513ed82bb8e7 (diff)
downloadchromium_src-588ad3c98ab23f0f0945d14fefd594fccdec38b7.zip
chromium_src-588ad3c98ab23f0f0945d14fefd594fccdec38b7.tar.gz
chromium_src-588ad3c98ab23f0f0945d14fefd594fccdec38b7.tar.bz2
[sync] Hide "Sync nothing" UI; Go back to signing out on dashboard clears and abandoned initial setup
A new "Sync nothing" option was recently added to the advanced sync settings dialog. It allowed the user to stop syncing, but stay signed in. In addition, sign in and sync were separated, with the result that on a dashboard clear, the user would remain signed in, but would no longer have sync enabled. For M29, we've decided to hide this UI and revert to old sign-in/out behavior because there are other services that depend on the sync engine being up and running. This patch undoes a small number of these changes as listed below: 1) Hides the "Sync nothing" item in the advanced sync settings drop-down 2) Signs out the user if the user clicks "Choose what to sync" during initial setup, and then clicks cancel on the advanced dialog 3) Signs out the user when a dashboard clear is done 4) Signs out the user if the user clicks cancel while re-setting up sync after the dashboard clear 5) Reverts the status string shown when sync is cleared via the dashboard BUG=235633, 252049, 248877 TEST=No "Sync nothing" UI in advanced settings; user is signed out when sync is disabled on Desktop; Chrome OS strings back to M28 Review URL: https://chromiumcodereview.appspot.com/17392009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209267 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd4
-rw-r--r--chrome/browser/resources/sync_setup_overlay.html6
-rw-r--r--chrome/browser/sync/profile_sync_service.cc8
-rw-r--r--chrome/browser/sync/sync_ui_util.cc9
-rw-r--r--chrome/browser/ui/webui/sync_setup_handler.cc7
5 files changed, 22 insertions, 12 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index a86e67c..60895f9 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -13509,9 +13509,7 @@ Some features may be unavailable. Please check that the profile exists and you
Signed in as <ph name="USER_EMAIL_ADDRESS">$1<ex>foo@gmail.com</ex></ph>. Sync is disabled by your administrator.
</message>
<message name="IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED" desc="The message that appears in the options dialog indicating that user is signed in with the given email address, but sync has been stopped.">
- Signed in as <ph name="USER_EMAIL_ADDRESS">$1<ex>foo@gmail.com</ex></ph>.
- <ph name="LINE_BREAK">&lt;br /&gt;<ex>&lt;br /&gt;</ex></ph>
- Sync has been stopped on this device. Manage your synced data on <ph name="BEGIN_LINK">&lt;a href="$2" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$2" target=&quot;_blank&quot;&gt;</ex></ph>Google Dashboard<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>.
+ Signed in as <ph name="USER_EMAIL_ADDRESS">$1<ex>foo@gmail.com</ex></ph>. Sync has been stopped via the Google Dashboard.
</message>
<message name="IDS_SYNC_ACCOUNT_SYNCING_TO_USER" desc="The message that appears in the options dialog indicating that account is syncing to a user with the given email address.">
Signed in as <ph name="USER_EMAIL_ADDRESS">$1<ex>foo@gmail.com</ex></ph>.
diff --git a/chrome/browser/resources/sync_setup_overlay.html b/chrome/browser/resources/sync_setup_overlay.html
index 3aa0d3e..f0bdfd3 100644
--- a/chrome/browser/resources/sync_setup_overlay.html
+++ b/chrome/browser/resources/sync_setup_overlay.html
@@ -34,7 +34,11 @@
<select id="sync-select-datatypes">
<option i18n-content="syncAllDataTypes" selected></option>
<option i18n-content="chooseDataTypes"></option>
- <option i18n-content="syncNothing"></option>
+ <!-- The syncNothing element is to be hidden for M29.
+ TODO(rsimha): Revisit this for M30.
+ See http://crbug.com/252049.
+ -->
+ <option i18n-content="syncNothing" hidden></option>
</select>
<div id="choose-data-types-body">
<div id="apps-item" class="sync-type-checkbox checkbox">
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index e9857e5..8a61a2e 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -1201,8 +1201,12 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) {
break;
case syncer::DISABLE_SYNC_ON_CLIENT:
OnStopSyncingPermanently();
- // TODO(rsimha): Re-evaluate whether to also sign out the user here after
- // a dashboard clear. See http://crbug.com/240436.
+#if !defined(OS_CHROMEOS)
+ // On desktop Chrome, sign out the user after a dashboard clear.
+ // TODO(rsimha): Revisit this for M30. See http://crbug.com/252049.
+ if (!auto_start_enabled_) // Skip sign out on ChromeOS/Android.
+ SigninManagerFactory::GetForProfile(profile_)->SignOut();
+#endif
break;
case syncer::STOP_SYNC_FOR_DISABLED_ACCOUNT:
// Sync disabled by domain admin. we should stop syncing until next
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index 46aebd5..645bc4c 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -56,10 +56,8 @@ string16 GetSyncedStateStatusLabel(ProfileSyncService* service,
user_name);
} else if (service->IsStartSuppressed()) {
// User is signed in, but sync has been stopped.
- return l10n_util::GetStringFUTF16(
- IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED,
- user_name,
- ASCIIToUTF16(chrome::kSyncGoogleDashboardURL));
+ return l10n_util::GetStringFUTF16(IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED,
+ user_name);
}
}
@@ -253,8 +251,7 @@ MessageType GetStatusInfo(ProfileSyncService* service,
if (status_label) {
string16 label = l10n_util::GetStringFUTF16(
IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED,
- UTF8ToUTF16(signin.GetAuthenticatedUsername()),
- ASCIIToUTF16(chrome::kSyncGoogleDashboardURL));
+ UTF8ToUTF16(signin.GetAuthenticatedUsername()));
status_label->assign(label);
result_type = PRE_SYNCED;
}
diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
index 5d353d9..11085ea 100644
--- a/chrome/browser/ui/webui/sync_setup_handler.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc
@@ -932,6 +932,13 @@ void SyncSetupHandler::CloseSyncSetup() {
if (sync_service) {
DVLOG(1) << "Sync setup aborted by user action";
sync_service->OnStopSyncingPermanently();
+#if !defined(OS_CHROMEOS)
+ // Sign out the user on desktop Chrome if they click cancel during
+ // initial setup.
+ // TODO(rsimha): Revisit this for M30. See http://crbug.com/252049.
+ if (sync_service->FirstSetupInProgress())
+ SigninManagerFactory::GetForProfile(GetProfile())->SignOut();
+#endif
}
}