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

Unified Diff: chrome/browser/net/gaia/gaia_oauth_fetcher.cc

Issue 8373021: Convert URLFetcher::Delegates to use an interface in content/public/common. Also remove the old U... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync and remove unncessary forward declares Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/gaia/gaia_oauth_fetcher.cc
===================================================================
--- chrome/browser/net/gaia/gaia_oauth_fetcher.cc (revision 106929)
+++ chrome/browser/net/gaia/gaia_oauth_fetcher.cc (working copy)
@@ -24,6 +24,7 @@
#include "chrome/common/net/http_return.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/common/net/url_fetcher.h"
#include "grit/chromium_strings.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_context_getter.h"
@@ -62,7 +63,7 @@
const std::string& body,
const std::string& headers,
bool send_cookies,
- URLFetcher::Delegate* delegate) {
+ content::URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
URLFetcher* result =
URLFetcher::Create(0,
@@ -654,18 +655,18 @@
}
}
-void GaiaOAuthFetcher::OnURLFetchComplete(const URLFetcher* source,
- const GURL& url,
- const net::URLRequestStatus& status,
- int response_code,
- const net::ResponseCookies& cookies,
- const std::string& data) {
+void GaiaOAuthFetcher::OnURLFetchComplete(const URLFetcher* source) {
// Keep |fetcher_| around to avoid invalidating its |status| (accessed below).
scoped_ptr<URLFetcher> current_fetcher(fetcher_.release());
fetch_pending_ = false;
GaiaUrls* gaia_urls = GaiaUrls::GetInstance();
+ GURL url = source->url();
+ std::string data;
+ source->GetResponseAsString(&data);
+ net::URLRequestStatus status = source->status();
+ int response_code = source->response_code();
if (StartsWithASCII(url.spec(), gaia_urls->get_oauth_token_url(), true)) {
- OnGetOAuthTokenUrlFetched(cookies, status, response_code);
+ OnGetOAuthTokenUrlFetched(source->cookies(), status, response_code);
} else if (url.spec() == gaia_urls->oauth1_login_url()) {
OnOAuthLoginFetched(data, status, response_code);
} else if (url.spec() == gaia_urls->oauth_get_access_token_url()) {

Powered by Google App Engine
This is Rietveld 408576698