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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 GaiaUrls::GetInstance()->client_login_to_oauth2_url()), | 217 GaiaUrls::GetInstance()->client_login_to_oauth2_url()), |
218 fetch_pending_(false) { | 218 fetch_pending_(false) { |
219 } | 219 } |
220 | 220 |
221 GaiaAuthFetcher::~GaiaAuthFetcher() {} | 221 GaiaAuthFetcher::~GaiaAuthFetcher() {} |
222 | 222 |
223 bool GaiaAuthFetcher::HasPendingFetch() { | 223 bool GaiaAuthFetcher::HasPendingFetch() { |
224 return fetch_pending_; | 224 return fetch_pending_; |
225 } | 225 } |
226 | 226 |
| 227 void GaiaAuthFetcher::SetPendingFetch(bool pending_fetch) { |
| 228 fetch_pending_ = pending_fetch; |
| 229 } |
| 230 |
227 void GaiaAuthFetcher::CancelRequest() { | 231 void GaiaAuthFetcher::CancelRequest() { |
228 fetcher_.reset(); | 232 fetcher_.reset(); |
229 fetch_pending_ = false; | 233 fetch_pending_ = false; |
230 } | 234 } |
231 | 235 |
232 void GaiaAuthFetcher::CreateAndStartGaiaFetcher(const std::string& body, | 236 void GaiaAuthFetcher::CreateAndStartGaiaFetcher(const std::string& body, |
233 const std::string& headers, | 237 const std::string& headers, |
234 const GURL& gaia_gurl, | 238 const GURL& gaia_gurl, |
235 int load_flags) { | 239 int load_flags) { |
236 DCHECK(!fetch_pending_) << "Tried to fetch two things at once!"; | 240 DCHECK(!fetch_pending_) << "Tried to fetch two things at once!"; |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 return alleged_error.find(kSecondFactor) != | 1118 return alleged_error.find(kSecondFactor) != |
1115 std::string::npos; | 1119 std::string::npos; |
1116 } | 1120 } |
1117 | 1121 |
1118 // static | 1122 // static |
1119 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( | 1123 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( |
1120 const std::string& alleged_error) { | 1124 const std::string& alleged_error) { |
1121 return alleged_error.find(kWebLoginRequired) != | 1125 return alleged_error.find(kWebLoginRequired) != |
1122 std::string::npos; | 1126 std::string::npos; |
1123 } | 1127 } |
OLD | NEW |