| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "google_apis/gaia/google_service_auth_error.h" | 5 #include "google_apis/gaia/google_service_auth_error.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 STATE_CASE(NONE); | 169 STATE_CASE(NONE); |
| 170 STATE_CASE(INVALID_GAIA_CREDENTIALS); | 170 STATE_CASE(INVALID_GAIA_CREDENTIALS); |
| 171 STATE_CASE(USER_NOT_SIGNED_UP); | 171 STATE_CASE(USER_NOT_SIGNED_UP); |
| 172 STATE_CASE(CONNECTION_FAILED); | 172 STATE_CASE(CONNECTION_FAILED); |
| 173 STATE_CASE(CAPTCHA_REQUIRED); | 173 STATE_CASE(CAPTCHA_REQUIRED); |
| 174 STATE_CASE(ACCOUNT_DELETED); | 174 STATE_CASE(ACCOUNT_DELETED); |
| 175 STATE_CASE(ACCOUNT_DISABLED); | 175 STATE_CASE(ACCOUNT_DISABLED); |
| 176 STATE_CASE(SERVICE_UNAVAILABLE); | 176 STATE_CASE(SERVICE_UNAVAILABLE); |
| 177 STATE_CASE(TWO_FACTOR); | 177 STATE_CASE(TWO_FACTOR); |
| 178 STATE_CASE(REQUEST_CANCELED); | 178 STATE_CASE(REQUEST_CANCELED); |
| 179 STATE_CASE(HOSTED_NOT_ALLOWED); | |
| 180 STATE_CASE(UNEXPECTED_SERVICE_RESPONSE); | 179 STATE_CASE(UNEXPECTED_SERVICE_RESPONSE); |
| 181 STATE_CASE(SERVICE_ERROR); | 180 STATE_CASE(SERVICE_ERROR); |
| 182 STATE_CASE(WEB_LOGIN_REQUIRED); | 181 STATE_CASE(WEB_LOGIN_REQUIRED); |
| 183 #undef STATE_CASE | 182 #undef STATE_CASE |
| 184 default: | 183 default: |
| 185 NOTREACHED(); | 184 NOTREACHED(); |
| 186 break; | 185 break; |
| 187 } | 186 } |
| 188 value->SetString("state", state_str); | 187 value->SetString("state", state_str); |
| 189 if (!error_message_.empty()) { | 188 if (!error_message_.empty()) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 return "Account deleted."; | 227 return "Account deleted."; |
| 229 case ACCOUNT_DISABLED: | 228 case ACCOUNT_DISABLED: |
| 230 return "Account disabled."; | 229 return "Account disabled."; |
| 231 case SERVICE_UNAVAILABLE: | 230 case SERVICE_UNAVAILABLE: |
| 232 return "Service unavailable; try again later."; | 231 return "Service unavailable; try again later."; |
| 233 case TWO_FACTOR: | 232 case TWO_FACTOR: |
| 234 return base::StringPrintf("2-step verification required (%s).", | 233 return base::StringPrintf("2-step verification required (%s).", |
| 235 second_factor_.token.c_str()); | 234 second_factor_.token.c_str()); |
| 236 case REQUEST_CANCELED: | 235 case REQUEST_CANCELED: |
| 237 return "Request canceled."; | 236 return "Request canceled."; |
| 238 case HOSTED_NOT_ALLOWED: | |
| 239 return "Google account required."; | |
| 240 case UNEXPECTED_SERVICE_RESPONSE: | 237 case UNEXPECTED_SERVICE_RESPONSE: |
| 241 return base::StringPrintf("Unexpected service response (%s)", | 238 return base::StringPrintf("Unexpected service response (%s)", |
| 242 error_message_.c_str()); | 239 error_message_.c_str()); |
| 243 case SERVICE_ERROR: | 240 case SERVICE_ERROR: |
| 244 return base::StringPrintf("Service responded with error: '%s'", | 241 return base::StringPrintf("Service responded with error: '%s'", |
| 245 error_message_.c_str()); | 242 error_message_.c_str()); |
| 246 case WEB_LOGIN_REQUIRED: | 243 case WEB_LOGIN_REQUIRED: |
| 247 return "Less secure apps may not authenticate with this account. " | 244 return "Less secure apps may not authenticate with this account. " |
| 248 "Please visit: " | 245 "Please visit: " |
| 249 "https://www.google.com/settings/security/lesssecureapps"; | 246 "https://www.google.com/settings/security/lesssecureapps"; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 const GURL& captcha_audio_url, | 279 const GURL& captcha_audio_url, |
| 283 const GURL& captcha_image_url, | 280 const GURL& captcha_image_url, |
| 284 const GURL& captcha_unlock_url, | 281 const GURL& captcha_unlock_url, |
| 285 int image_width, | 282 int image_width, |
| 286 int image_height) | 283 int image_height) |
| 287 : state_(s), | 284 : state_(s), |
| 288 captcha_(captcha_token, captcha_audio_url, captcha_image_url, | 285 captcha_(captcha_token, captcha_audio_url, captcha_image_url, |
| 289 captcha_unlock_url, image_width, image_height), | 286 captcha_unlock_url, image_width, image_height), |
| 290 network_error_(0) { | 287 network_error_(0) { |
| 291 } | 288 } |
| OLD | NEW |