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

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

Issue 7574009: Added OAuth support to TokenService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaked mock for OnOAuthWrapBridgeFailure. Created 9 years, 4 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
diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
index 243f1935e31ab6972a0e53da161c2046e5affff1..18ceeec95290a9a66e13ed5cd42566d6330d53c2 100644
--- a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
+++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
@@ -54,13 +54,11 @@ static const char kOAuthTokenCookie[] = "oauth_token";
GaiaOAuthFetcher::GaiaOAuthFetcher(GaiaOAuthConsumer* consumer,
net::URLRequestContextGetter* getter,
Profile* profile,
- const std::string& service_name,
const std::string& service_scope)
: consumer_(consumer),
getter_(getter),
profile_(profile),
popup_(NULL),
- service_name_(service_name),
service_scope_(service_scope),
fetch_pending_(false),
auto_fetch_limit_(ALL_OAUTH_STEPS) {}
@@ -408,14 +406,13 @@ void GaiaOAuthFetcher::StartOAuthWrapBridge(
const std::string& oauth1_access_token,
const std::string& oauth1_access_token_secret,
const std::string& wrap_token_duration,
- const std::string& service_name,
const std::string& service_scope) {
DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
- VLOG(1) << "Starting OAuthWrapBridge for: " << service_name;
+ VLOG(1) << "Starting OAuthWrapBridge for: " << service_scope;
std::string combined_scope = service_scope + " " +
kOAuthWrapBridgeUserInfoScope;
- service_name_ = service_name;
+ service_scope_ = service_scope;
// Must outlive fetcher_.
request_body_ = MakeOAuthWrapBridgeBody(
@@ -595,7 +592,7 @@ void GaiaOAuthFetcher::OnOAuthGetAccessTokenFetched(
consumer_->OnOAuthGetAccessTokenSuccess(token, secret);
if (ShouldAutoFetch(OAUTH2_SERVICE_ACCESS_TOKEN))
StartOAuthWrapBridge(
- token, secret, "3600", service_name_, service_scope_);
+ token, secret, GaiaConstants::kGaiaOAuthDuration, service_scope_);
} else {
consumer_->OnOAuthGetAccessTokenFailure(GenerateAuthError(data, status));
}
@@ -610,11 +607,12 @@ void GaiaOAuthFetcher::OnOAuthWrapBridgeFetched(
std::string token;
std::string expires_in;
ParseOAuthWrapBridgeResponse(data, &token, &expires_in);
- consumer_->OnOAuthWrapBridgeSuccess(service_name_, token, expires_in);
+ consumer_->OnOAuthWrapBridgeSuccess(service_scope_, token, expires_in);
if (ShouldAutoFetch(USER_INFO))
StartUserInfo(token);
} else {
- consumer_->OnOAuthWrapBridgeFailure(GenerateAuthError(data, status));
+ consumer_->OnOAuthWrapBridgeFailure(service_scope_,
+ GenerateAuthError(data, status));
}
}
« no previous file with comments | « chrome/browser/net/gaia/gaia_oauth_fetcher.h ('k') | chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698