Chromium Code Reviews| 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; |
| } |
| } |