Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: chrome/common/net/gaia/gaia_auth_fetcher.cc

Issue 10386063: Move URLFetcherDelegate to net/ and split URLFetcher between net/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head, fix win component build Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/net/gaia/gaia_auth_fetcher.h ('k') | chrome/common/net/gaia/gaia_oauth_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/common/net/gaia/gaia_auth_fetcher.h" 5 #include "chrome/common/net/gaia/gaia_auth_fetcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 std::string lsid; 1107 std::string lsid;
1108 std::string token; 1108 std::string token;
1109 ParseClientLoginResponse(data, &sid, &lsid, &token); 1109 ParseClientLoginResponse(data, &sid, &lsid, &token);
1110 consumer_->OnClientLoginSuccess( 1110 consumer_->OnClientLoginSuccess(
1111 GaiaAuthConsumer::ClientLoginResult(sid, lsid, token, data)); 1111 GaiaAuthConsumer::ClientLoginResult(sid, lsid, token, data));
1112 } else { 1112 } else {
1113 consumer_->OnClientLoginFailure(GenerateAuthError(data, status)); 1113 consumer_->OnClientLoginFailure(GenerateAuthError(data, status));
1114 } 1114 }
1115 } 1115 }
1116 1116
1117 void GaiaAuthFetcher::OnURLFetchComplete(const content::URLFetcher* source) { 1117 void GaiaAuthFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
1118 fetch_pending_ = false; 1118 fetch_pending_ = false;
1119 // Some of the GAIA requests perform redirects, which results in the final 1119 // Some of the GAIA requests perform redirects, which results in the final
1120 // URL of the fetcher not being the original URL requested. Therefore use 1120 // URL of the fetcher not being the original URL requested. Therefore use
1121 // the original URL when determining which OnXXX function to call. 1121 // the original URL when determining which OnXXX function to call.
1122 const GURL& url = source->GetOriginalURL(); 1122 const GURL& url = source->GetOriginalURL();
1123 const net::URLRequestStatus& status = source->GetStatus(); 1123 const net::URLRequestStatus& status = source->GetStatus();
1124 int response_code = source->GetResponseCode(); 1124 int response_code = source->GetResponseCode();
1125 std::string data; 1125 std::string data;
1126 source->GetResponseAsString(&data); 1126 source->GetResponseAsString(&data);
1127 if (url == client_login_gurl_) { 1127 if (url == client_login_gurl_) {
(...skipping 21 matching lines...) Expand all
1149 NOTREACHED(); 1149 NOTREACHED();
1150 } 1150 }
1151 } 1151 }
1152 1152
1153 // static 1153 // static
1154 bool GaiaAuthFetcher::IsSecondFactorSuccess( 1154 bool GaiaAuthFetcher::IsSecondFactorSuccess(
1155 const std::string& alleged_error) { 1155 const std::string& alleged_error) {
1156 return alleged_error.find(kSecondFactor) != 1156 return alleged_error.find(kSecondFactor) !=
1157 std::string::npos; 1157 std::string::npos;
1158 } 1158 }
OLDNEW
« no previous file with comments | « chrome/common/net/gaia/gaia_auth_fetcher.h ('k') | chrome/common/net/gaia/gaia_oauth_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698