Index: chrome/browser/sync/sync_status_ui_helper.cc |
=================================================================== |
--- chrome/browser/sync/sync_status_ui_helper.cc (revision 30060) |
+++ chrome/browser/sync/sync_status_ui_helper.cc (working copy) |
@@ -17,50 +17,52 @@ |
// status message and, if necessary, the text that should appear in the |
// re-login link. |
static void GetLabelsForAuthError(AuthErrorState auth_error, |
- ProfileSyncService* service, std::wstring* status_label, |
- std::wstring* link_label) { |
+ ProfileSyncService* service, string16* status_label, |
+ string16* link_label) { |
if (link_label) |
- link_label->assign(l10n_util::GetString(IDS_SYNC_RELOGIN_LINK_LABEL)); |
+ link_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_RELOGIN_LINK_LABEL)); |
if (auth_error == AUTH_ERROR_INVALID_GAIA_CREDENTIALS) { |
// If the user name is empty then the first login failed, otherwise the |
// credentials are out-of-date. |
if (service->GetAuthenticatedUsername().empty()) |
status_label->assign( |
- l10n_util::GetString(IDS_SYNC_INVALID_USER_CREDENTIALS)); |
+ l10n_util::GetStringUTF16(IDS_SYNC_INVALID_USER_CREDENTIALS)); |
else |
status_label->assign( |
- l10n_util::GetString(IDS_SYNC_LOGIN_INFO_OUT_OF_DATE)); |
+ l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_INFO_OUT_OF_DATE)); |
} else if (auth_error == AUTH_ERROR_CONNECTION_FAILED) { |
// Note that there is little the user can do if the server is not |
// reachable. Since attempting to re-connect is done automatically by |
// the Syncer, we do not show the (re)login link. |
status_label->assign( |
- l10n_util::GetStringF(IDS_SYNC_SERVER_IS_UNREACHABLE, |
- l10n_util::GetString(IDS_PRODUCT_NAME))); |
+ l10n_util::GetStringFUTF16(IDS_SYNC_SERVER_IS_UNREACHABLE, |
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
if (link_label) |
link_label->clear(); |
} else { |
- status_label->assign(l10n_util::GetString(IDS_SYNC_ERROR_SIGNING_IN)); |
+ status_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_ERROR_SIGNING_IN)); |
} |
} |
// 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. |
-static std::wstring GetSyncedStateStatusLabel(ProfileSyncService* service) { |
- std::wstring label; |
- std::wstring user_name(UTF16ToWide(service->GetAuthenticatedUsername())); |
+static string16 GetSyncedStateStatusLabel(ProfileSyncService* service) { |
+ string16 label; |
+ string16 user_name(service->GetAuthenticatedUsername()); |
if (user_name.empty()) |
return label; |
- return l10n_util::GetStringF(IDS_SYNC_ACCOUNT_SYNCED_TO_USER_WITH_TIME, |
- user_name, service->GetLastSyncedTimeString()); |
+ return l10n_util::GetStringFUTF16( |
+ IDS_SYNC_ACCOUNT_SYNCED_TO_USER_WITH_TIME, |
+ user_name, |
+ WideToUTF16(service->GetLastSyncedTimeString())); |
} |
// static |
SyncStatusUIHelper::MessageType SyncStatusUIHelper::GetLabels( |
- ProfileSyncService* service, std::wstring* status_label, |
- std::wstring* link_label) { |
+ ProfileSyncService* service, string16* status_label, |
+ string16* link_label) { |
MessageType result_type(SYNCED); |
if (!service) { |
@@ -78,7 +80,8 @@ |
status_label->assign(GetSyncedStateStatusLabel(service)); |
DCHECK_EQ(auth_error, AUTH_ERROR_NONE); |
} else if (service->UIShouldDepictAuthInProgress()) { |
- status_label->assign(l10n_util::GetString(IDS_SYNC_AUTHENTICATING_LABEL)); |
+ status_label->assign( |
+ l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL)); |
result_type = PRE_SYNCED; |
} else if (auth_error != AUTH_ERROR_NONE) { |
GetLabelsForAuthError(auth_error, service, status_label, link_label); |
@@ -92,23 +95,23 @@ |
ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); |
AuthErrorState auth_error(service->GetAuthErrorState()); |
status_label->assign( |
- l10n_util::GetString(IDS_SYNC_NTP_SETUP_IN_PROGRESS)); |
+ l10n_util::GetStringUTF16(IDS_SYNC_NTP_SETUP_IN_PROGRESS)); |
if (service->UIShouldDepictAuthInProgress()) { |
status_label->assign( |
- l10n_util::GetString(IDS_SYNC_AUTHENTICATING_LABEL)); |
+ l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL)); |
} else if (auth_error != AUTH_ERROR_NONE) { |
status_label->clear(); |
GetLabelsForAuthError(auth_error, service, status_label, NULL); |
result_type = SYNC_ERROR; |
} else if (!status.authenticated) { |
status_label->assign( |
- l10n_util::GetString(IDS_SYNC_ACCOUNT_DETAILS_NOT_ENTERED)); |
+ l10n_util::GetStringUTF16(IDS_SYNC_ACCOUNT_DETAILS_NOT_ENTERED)); |
} |
} else if (service->unrecoverable_error_detected()) { |
result_type = SYNC_ERROR; |
- status_label->assign(l10n_util::GetString(IDS_SYNC_SETUP_ERROR)); |
+ status_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_SETUP_ERROR)); |
} else { |
- status_label->assign(l10n_util::GetString(IDS_SYNC_NOT_SET_UP_INFO)); |
+ status_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_NOT_SET_UP_INFO)); |
} |
} |
return result_type; |