| 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 17 matching lines...) Expand all Loading... |
| 28 #include "net/url_request/url_request_status.h" | 28 #include "net/url_request/url_request_status.h" |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 const int kLoadFlagsIgnoreCookies = net::LOAD_DO_NOT_SEND_COOKIES | | 31 const int kLoadFlagsIgnoreCookies = net::LOAD_DO_NOT_SEND_COOKIES | |
| 32 net::LOAD_DO_NOT_SAVE_COOKIES; | 32 net::LOAD_DO_NOT_SAVE_COOKIES; |
| 33 | 33 |
| 34 static bool CookiePartsContains(const std::vector<std::string>& parts, | 34 static bool CookiePartsContains(const std::vector<std::string>& parts, |
| 35 const char* part) { | 35 const char* part) { |
| 36 for (std::vector<std::string>::const_iterator it = parts.begin(); | 36 for (std::vector<std::string>::const_iterator it = parts.begin(); |
| 37 it != parts.end(); ++it) { | 37 it != parts.end(); ++it) { |
| 38 if (LowerCaseEqualsASCII(*it, part)) | 38 if (base::LowerCaseEqualsASCII(*it, part)) |
| 39 return true; | 39 return true; |
| 40 } | 40 } |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 // From the JSON string |data|, extract the |access_token| and |expires_in_secs| | 44 // From the JSON string |data|, extract the |access_token| and |expires_in_secs| |
| 45 // both of which must exist. If the |refresh_token| is non-NULL, then it also | 45 // both of which must exist. If the |refresh_token| is non-NULL, then it also |
| 46 // must exist and is extraced; if it's NULL, then no extraction is attempted. | 46 // must exist and is extraced; if it's NULL, then no extraction is attempted. |
| 47 bool ExtractOAuth2TokenPairResponse(const std::string& data, | 47 bool ExtractOAuth2TokenPairResponse(const std::string& data, |
| 48 std::string* refresh_token, | 48 std::string* refresh_token, |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 return alleged_error.find(kSecondFactor) != | 1118 return alleged_error.find(kSecondFactor) != |
| 1119 std::string::npos; | 1119 std::string::npos; |
| 1120 } | 1120 } |
| 1121 | 1121 |
| 1122 // static | 1122 // static |
| 1123 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( | 1123 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( |
| 1124 const std::string& alleged_error) { | 1124 const std::string& alleged_error) { |
| 1125 return alleged_error.find(kWebLoginRequired) != | 1125 return alleged_error.find(kWebLoginRequired) != |
| 1126 std::string::npos; | 1126 std::string::npos; |
| 1127 } | 1127 } |
| OLD | NEW |