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/gaia_auth_fetcher.h" | 5 #include "google_apis/gaia/gaia_auth_fetcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 492 |
493 base::ListValue* sessionsList; | 493 base::ListValue* sessionsList; |
494 if (!dict->GetList("sessions", &sessionsList)) | 494 if (!dict->GetList("sessions", &sessionsList)) |
495 return false; | 495 return false; |
496 | 496 |
497 // Find the first login_hint present in any session. | 497 // Find the first login_hint present in any session. |
498 for (base::ListValue::iterator iter = sessionsList->begin(); | 498 for (base::ListValue::iterator iter = sessionsList->begin(); |
499 iter != sessionsList->end(); | 499 iter != sessionsList->end(); |
500 iter++) { | 500 iter++) { |
501 base::DictionaryValue* sessionDictionary; | 501 base::DictionaryValue* sessionDictionary; |
502 if (!(*iter)->GetAsDictionary(&sessionDictionary)) | 502 if (!iter->GetAsDictionary(&sessionDictionary)) |
503 continue; | 503 continue; |
504 | 504 |
505 if (sessionDictionary->GetString("login_hint", login_hint)) | 505 if (sessionDictionary->GetString("login_hint", login_hint)) |
506 break; | 506 break; |
507 } | 507 } |
508 | 508 |
509 if (login_hint->empty()) | 509 if (login_hint->empty()) |
510 return false; | 510 return false; |
511 return true; | 511 return true; |
512 } | 512 } |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 return alleged_error.find(kSecondFactor) != | 1015 return alleged_error.find(kSecondFactor) != |
1016 std::string::npos; | 1016 std::string::npos; |
1017 } | 1017 } |
1018 | 1018 |
1019 // static | 1019 // static |
1020 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( | 1020 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( |
1021 const std::string& alleged_error) { | 1021 const std::string& alleged_error) { |
1022 return alleged_error.find(kWebLoginRequired) != | 1022 return alleged_error.find(kWebLoginRequired) != |
1023 std::string::npos; | 1023 std::string::npos; |
1024 } | 1024 } |
OLD | NEW |