| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/signin/signin_ui_util.h" | 5 #include "chrome/browser/signin/signin_ui_util.h" |
| 6 | 6 |
| 7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/signin/signin_global_error.h" | 10 #include "chrome/browser/signin/signin_global_error.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 string16* link_label) { | 94 string16* link_label) { |
| 95 string16 username = UTF8ToUTF16(signin_manager.GetAuthenticatedUsername()); | 95 string16 username = UTF8ToUTF16(signin_manager.GetAuthenticatedUsername()); |
| 96 string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 96 string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| 97 if (link_label) | 97 if (link_label) |
| 98 link_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_RELOGIN_LINK_LABEL)); | 98 link_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_RELOGIN_LINK_LABEL)); |
| 99 | 99 |
| 100 const GoogleServiceAuthError::State state = | 100 const GoogleServiceAuthError::State state = |
| 101 SigninGlobalError::GetForProfile(profile)->GetLastAuthError().state(); | 101 SigninGlobalError::GetForProfile(profile)->GetLastAuthError().state(); |
| 102 switch (state) { | 102 switch (state) { |
| 103 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: | 103 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: |
| 104 case GoogleServiceAuthError::SERVICE_ERROR: |
| 104 case GoogleServiceAuthError::ACCOUNT_DELETED: | 105 case GoogleServiceAuthError::ACCOUNT_DELETED: |
| 105 case GoogleServiceAuthError::ACCOUNT_DISABLED: | 106 case GoogleServiceAuthError::ACCOUNT_DISABLED: |
| 106 // If the user name is empty then the first login failed, otherwise the | 107 // If the user name is empty then the first login failed, otherwise the |
| 107 // credentials are out-of-date. | 108 // credentials are out-of-date. |
| 108 if (username.empty()) { | 109 if (username.empty()) { |
| 109 if (status_label) { | 110 if (status_label) { |
| 110 status_label->assign( | 111 status_label->assign( |
| 111 l10n_util::GetStringUTF16(IDS_SYNC_INVALID_USER_CREDENTIALS)); | 112 l10n_util::GetStringUTF16(IDS_SYNC_INVALID_USER_CREDENTIALS)); |
| 112 } | 113 } |
| 113 } else { | 114 } else { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 140 default: | 141 default: |
| 141 if (status_label) { | 142 if (status_label) { |
| 142 status_label->assign(l10n_util::GetStringUTF16( | 143 status_label->assign(l10n_util::GetStringUTF16( |
| 143 IDS_SYNC_ERROR_SIGNING_IN)); | 144 IDS_SYNC_ERROR_SIGNING_IN)); |
| 144 } | 145 } |
| 145 break; | 146 break; |
| 146 } | 147 } |
| 147 } | 148 } |
| 148 | 149 |
| 149 } // namespace signin_ui_util | 150 } // namespace signin_ui_util |
| OLD | NEW |