Index: chrome/browser/signin/signin_ui_util.cc |
diff --git a/chrome/browser/signin/signin_ui_util.cc b/chrome/browser/signin/signin_ui_util.cc |
index a7a6c9928b91c43d10b34aa601ec2cf67435b446..88168ec92eb5e3966e9ef3fd869ca325c64d8562 100644 |
--- a/chrome/browser/signin/signin_ui_util.cc |
+++ b/chrome/browser/signin/signin_ui_util.cc |
@@ -4,6 +4,8 @@ |
#include "chrome/browser/signin/signin_ui_util.h" |
+#include <string> |
tommycli
2016/10/28 21:21:09
nit: not needed if included in .h file'
Moe
2016/11/01 19:44:01
Done.
|
+ |
#include "base/strings/sys_string_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#include "build/build_config.h" |
@@ -53,67 +55,6 @@ base::string16 GetAuthenticatedUsername(const SigninManagerBase* signin) { |
return base::UTF8ToUTF16(user_display_name); |
} |
-// Given an authentication state this helper function returns various labels |
-// that can be used to display information about the state. |
-void GetStatusLabelsForAuthError(Profile* profile, |
- const SigninManagerBase& signin_manager, |
- base::string16* status_label, |
- base::string16* link_label) { |
- base::string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
- if (link_label) |
- link_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_RELOGIN_LINK_LABEL)); |
- |
- const GoogleServiceAuthError::State state = |
- SigninErrorControllerFactory::GetForProfile(profile)-> |
- auth_error().state(); |
- switch (state) { |
- case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: |
- case GoogleServiceAuthError::SERVICE_ERROR: |
- case GoogleServiceAuthError::ACCOUNT_DELETED: |
- case GoogleServiceAuthError::ACCOUNT_DISABLED: |
- // If the user name is empty then the first login failed, otherwise the |
- // credentials are out-of-date. |
- if (!signin_manager.IsAuthenticated()) { |
- if (status_label) { |
- status_label->assign( |
- l10n_util::GetStringUTF16(IDS_SYNC_INVALID_USER_CREDENTIALS)); |
- } |
- } else { |
- if (status_label) { |
- status_label->assign( |
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_INFO_OUT_OF_DATE)); |
- } |
- } |
- break; |
- case GoogleServiceAuthError::SERVICE_UNAVAILABLE: |
- if (status_label) { |
- status_label->assign( |
- l10n_util::GetStringUTF16(IDS_SYNC_SERVICE_UNAVAILABLE)); |
- } |
- if (link_label) |
- link_label->clear(); |
- break; |
- case GoogleServiceAuthError::CONNECTION_FAILED: |
- if (status_label) { |
- status_label->assign( |
- l10n_util::GetStringFUTF16(IDS_SYNC_SERVER_IS_UNREACHABLE, |
- product_name)); |
- } |
- // 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. |
- if (link_label) |
- link_label->clear(); |
- break; |
- default: |
- if (status_label) { |
- status_label->assign(l10n_util::GetStringUTF16( |
- IDS_SYNC_ERROR_SIGNING_IN)); |
- } |
- break; |
- } |
-} |
- |
void InitializePrefsForProfile(Profile* profile) { |
if (profile->IsNewProfile()) { |
// Suppresses the upgrade tutorial for a new profile. |