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

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

Issue 11649055: OAuth2 sign-in flow for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
index 521e0d89702bf87b248b2e7a581da7844b4de739..93452104d52d4981d603b40a488f1b6bb2dc7308 100644
--- a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
+++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
@@ -11,6 +11,7 @@
#include "base/json/json_reader.h"
#include "base/string_split.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/net/gaia/gaia_oauth_consumer.h"
#include "chrome/common/net/url_util.h"
@@ -19,6 +20,7 @@
#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/gaia/oauth_request_signer.h"
#include "grit/chromium_strings.h"
+#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/cookies/parsed_cookie.h"
#include "net/http/http_status_code.h"
@@ -27,7 +29,14 @@
#include "net/url_request/url_request_status.h"
#include "ui/base/l10n/l10n_util.h"
-static const char kOAuthTokenCookie[] = "oauth_token";
+namespace {
+
+const char kOAuthTokenCookie[] = "oauth_token";
+const char kOAuth2LoginBodyFormat[] =
+ "source=%s&"
+ "service=%s";
xiyuan 2013/01/07 23:07:55 kOAuth2LoginBodyFormat is not used anywhere. And I
zel 2013/01/08 02:05:41 changes to gaia_oauth_fetcher.cc/h are reverted no
+
+} // namespace
GaiaOAuthFetcher::GaiaOAuthFetcher(GaiaOAuthConsumer* consumer,
net::URLRequestContextGetter* getter,
@@ -254,7 +263,7 @@ void GaiaOAuthFetcher::ParseUserInfoResponse(const std::string& data,
}
}
-void GaiaOAuthFetcher::StartOAuthLogin(
+void GaiaOAuthFetcher::StartOAuth1Login(
const char* source,
const char* service,
const std::string& oauth1_access_token,
@@ -549,15 +558,18 @@ void GaiaOAuthFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
case OAUTH1_ALL_ACCESS_TOKEN:
OnOAuthGetAccessTokenFetched(data, status, response_code);
break;
+ case OAUTH2_LOGIN:
+ OnOAuthLoginFetched(data, status, response_code);
+ break;
case OAUTH2_SERVICE_ACCESS_TOKEN:
OnOAuthWrapBridgeFetched(data, status, response_code);
break;
- case USER_INFO:
- OnUserInfoFetched(data, status, response_code);
- break;
case OAUTH2_REVOKE_TOKEN:
OnOAuthRevokeTokenFetched(data, status, response_code);
break;
+ case USER_INFO:
+ OnUserInfoFetched(data, status, response_code);
+ break;
}
}

Powered by Google App Engine
This is Rietveld 408576698