| 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_global_error.h" | 5 #include "chrome/browser/signin/signin_global_error.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 case GoogleServiceAuthError::NONE: | 162 case GoogleServiceAuthError::NONE: |
| 163 return messages; | 163 return messages; |
| 164 | 164 |
| 165 // TODO(rogerta): use account id in error messages. | 165 // TODO(rogerta): use account id in error messages. |
| 166 | 166 |
| 167 // User credentials are invalid (bad acct, etc). | 167 // User credentials are invalid (bad acct, etc). |
| 168 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: | 168 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: |
| 169 case GoogleServiceAuthError::SERVICE_ERROR: | 169 case GoogleServiceAuthError::SERVICE_ERROR: |
| 170 case GoogleServiceAuthError::ACCOUNT_DELETED: | 170 case GoogleServiceAuthError::ACCOUNT_DELETED: |
| 171 case GoogleServiceAuthError::ACCOUNT_DISABLED: | 171 case GoogleServiceAuthError::ACCOUNT_DISABLED: |
| 172 messages.push_back(l10n_util::GetStringFUTF16( | 172 messages.push_back(l10n_util::GetStringUTF16( |
| 173 IDS_SYNC_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE, | 173 IDS_SYNC_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE)); |
| 174 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | |
| 175 break; | 174 break; |
| 176 | 175 |
| 177 // Sync service is not available for this account's domain. | 176 // Sync service is not available for this account's domain. |
| 178 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: | 177 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: |
| 179 messages.push_back(l10n_util::GetStringFUTF16( | 178 messages.push_back(l10n_util::GetStringUTF16( |
| 180 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE, | 179 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE)); |
| 181 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | |
| 182 break; | 180 break; |
| 183 | 181 |
| 184 // Generic message for "other" errors. | 182 // Generic message for "other" errors. |
| 185 default: | 183 default: |
| 186 messages.push_back(l10n_util::GetStringFUTF16( | 184 messages.push_back(l10n_util::GetStringUTF16( |
| 187 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE, | 185 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE)); |
| 188 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | |
| 189 } | 186 } |
| 190 return messages; | 187 return messages; |
| 191 } | 188 } |
| 192 | 189 |
| 193 base::string16 SigninGlobalError::GetBubbleViewAcceptButtonLabel() { | 190 base::string16 SigninGlobalError::GetBubbleViewAcceptButtonLabel() { |
| 194 // If the service is unavailable, don't give the user the option to try | 191 // If the service is unavailable, don't give the user the option to try |
| 195 // signing in again. | 192 // signing in again. |
| 196 if (auth_error_.state() == GoogleServiceAuthError::SERVICE_UNAVAILABLE) { | 193 if (auth_error_.state() == GoogleServiceAuthError::SERVICE_UNAVAILABLE) { |
| 197 return l10n_util::GetStringUTF16( | 194 return l10n_util::GetStringUTF16( |
| 198 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_ACCEPT); | 195 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_ACCEPT); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 214 | 211 |
| 215 void SigninGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { | 212 void SigninGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { |
| 216 NOTREACHED(); | 213 NOTREACHED(); |
| 217 } | 214 } |
| 218 | 215 |
| 219 // static | 216 // static |
| 220 SigninGlobalError* SigninGlobalError::GetForProfile(Profile* profile) { | 217 SigninGlobalError* SigninGlobalError::GetForProfile(Profile* profile) { |
| 221 return ProfileOAuth2TokenServiceFactory::GetForProfile(profile)-> | 218 return ProfileOAuth2TokenServiceFactory::GetForProfile(profile)-> |
| 222 signin_global_error(); | 219 signin_global_error(); |
| 223 } | 220 } |
| OLD | NEW |