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 7264b48addc47d9d5180c074389d9cfa0e5baca4..d69c912ac152c47b65291f41a4dce8de32f4216e 100644 |
--- a/chrome/browser/sync/sync_ui_util.cc |
+++ b/chrome/browser/sync/sync_ui_util.cc |
@@ -131,16 +131,24 @@ void GetStatusLabelsForAuthError(const AuthError& auth_error, |
// Returns the message that should be displayed when the user is authenticated |
// and can connect to the sync server. If the user hasn't yet authenticated, an |
// empty string is returned. |
-string16 GetSyncedStateStatusLabel(ProfileSyncService* service) { |
+string16 GetSyncedStateStatusLabel(ProfileSyncService* service, |
+ bool html_links) { |
akalin
2011/10/28 19:10:22
indent with (
jimblackler
2011/11/01 16:15:30
Done.
jimblackler
2011/11/01 16:15:30
Done.
|
string16 label; |
string16 user_name(service->GetAuthenticatedUsername()); |
if (user_name.empty()) |
return label; |
- return l10n_util::GetStringFUTF16( |
- IDS_SYNC_ACCOUNT_SYNCING_TO_USER, |
- user_name, |
- ASCIIToUTF16(chrome::kSyncGoogleDashboardURL)); |
+ // Message may also carry additional advice with an HTML link, if acceptable. |
+ if (html_links) { |
+ return l10n_util::GetStringFUTF16( |
+ IDS_SYNC_ACCOUNT_SYNCING_TO_USER_WITH_MANAGE_LINK, |
+ user_name, |
+ ASCIIToUTF16(chrome::kSyncGoogleDashboardURL)); |
+ } else { |
+ return l10n_util::GetStringFUTF16( |
+ IDS_SYNC_ACCOUNT_SYNCING_TO_USER, |
+ user_name); |
+ } |
} |
void GetStatusForActionableError( |
@@ -175,7 +183,8 @@ void GetStatusForActionableError( |
// status_label and link_label must either be both NULL or both non-NULL. |
MessageType GetStatusInfo(ProfileSyncService* service, |
string16* status_label, |
- string16* link_label) { |
+ string16* link_label, |
+ bool html_links) { |
DCHECK_EQ(status_label == NULL, link_label == NULL); |
MessageType result_type(SYNCED); |
@@ -236,7 +245,7 @@ MessageType GetStatusInfo(ProfileSyncService* service, |
// current synced status. Return SYNC_PROMO so that |
// the configure link will still be shown. |
if (status_label && link_label) { |
- status_label->assign(GetSyncedStateStatusLabel(service)); |
+ status_label->assign(GetSyncedStateStatusLabel(service, html_links)); |
link_label->assign( |
l10n_util::GetStringUTF16(IDS_SYNC_PASSWORD_SYNC_ATTENTION)); |
} |
@@ -246,7 +255,7 @@ MessageType GetStatusInfo(ProfileSyncService* service, |
// There is no error. Display "Last synced..." message. |
if (status_label) |
- status_label->assign(GetSyncedStateStatusLabel(service)); |
+ status_label->assign(GetSyncedStateStatusLabel(service, html_links)); |
return SYNCED; |
} else { |
// Either show auth error information with a link to re-login, auth in prog, |
@@ -328,17 +337,19 @@ MessageType GetStatusInfoForNewTabPage(ProfileSyncService* service, |
} |
// Fallback to default. |
- return GetStatusInfo(service, status_label, link_label); |
+ return GetStatusInfo(service, status_label, link_label, true); |
} |
} // namespace |
MessageType GetStatusLabels(ProfileSyncService* service, |
string16* status_label, |
- string16* link_label) { |
+ string16* link_label, |
+ bool html_links) { |
DCHECK(status_label); |
DCHECK(link_label); |
- return sync_ui_util::GetStatusInfo(service, status_label, link_label); |
+ return sync_ui_util::GetStatusInfo(service, status_label, link_label, |
+ html_links); |
akalin
2011/10/28 19:10:22
indent with (
jimblackler
2011/11/01 16:15:30
Done.
|
} |
MessageType GetStatusLabelsForNewTabPage(ProfileSyncService* service, |
@@ -389,7 +400,7 @@ void GetStatusLabelsForSyncGlobalError(ProfileSyncService* service, |
} |
MessageType GetStatus(ProfileSyncService* service) { |
- return sync_ui_util::GetStatusInfo(service, NULL, NULL); |
+ return sync_ui_util::GetStatusInfo(service, NULL, NULL, true); |
} |
string16 GetSyncMenuLabel(ProfileSyncService* service) { |