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

Unified Diff: chrome/browser/sync/sync_ui_util.cc

Issue 14691004: [sync] Separate sign in from sync on Desktop Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/sync/sync_ui_util.cc
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index a8cd618e63474294d89b65926ded4a262712aacf..22856c0cc5712d79045126a4694519b95b0dcd8c 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -55,6 +55,7 @@ string16 GetSyncedStateStatusLabel(ProfileSyncService* service,
return l10n_util::GetStringFUTF16(IDS_SIGNED_IN_WITH_SYNC_DISABLED,
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);
}
@@ -226,10 +227,10 @@ MessageType GetStatusInfo(ProfileSyncService* service,
}
} else if (auth_error.state() != AuthError::NONE &&
auth_error.state() != AuthError::TWO_FACTOR) {
- if (status_label) {
+ if (status_label && link_label) {
status_label->clear();
signin_ui_util::GetStatusLabelsForAuthError(
- signin, status_label, NULL);
+ signin, status_label, link_label);
}
result_type = SYNC_ERROR;
}
@@ -245,6 +246,15 @@ MessageType GetStatusInfo(ProfileSyncService* service,
} else if (status_label) {
status_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_SETUP_ERROR));
}
+ } else if (!signin.GetAuthenticatedUsername().empty()) {
+ // The user is signed in, but sync has been stopped.
+ if (status_label) {
+ string16 label = l10n_util::GetStringFUTF16(
+ IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED,
+ UTF8ToUTF16(signin.GetAuthenticatedUsername()));
+ status_label->assign(label);
+ result_type = PRE_SYNCED;
+ }
}
}
return result_type;

Powered by Google App Engine
This is Rietveld 408576698