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

Unified Diff: chrome/browser/chromeos/gdata/gdata_auth_service.cc

Issue 10827018: gdata: Rename functions in GDataAuthService per OAuth2 terminology (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 5 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/chromeos/gdata/gdata_auth_service.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_auth_service.cc b/chrome/browser/chromeos/gdata/gdata_auth_service.cc
index 20e1702513ece48b6a5a08126b52dbee70d8f369..2b335a9fec0594b42b3f0aae33469dbc19bda90b 100644
--- a/chrome/browser/chromeos/gdata/gdata_auth_service.cc
+++ b/chrome/browser/chromeos/gdata/gdata_auth_service.cc
@@ -55,10 +55,10 @@ void GDataAuthService::StartAuthentication(
scoped_refptr<base::MessageLoopProxy> relay_proxy(
base::MessageLoopProxy::current());
- if (IsFullyAuthenticated()) {
+ if (HasAccessToken()) {
relay_proxy->PostTask(FROM_HERE,
- base::Bind(callback, gdata::HTTP_SUCCESS, oauth2_auth_token()));
- } else if (IsPartiallyAuthenticated()) {
+ base::Bind(callback, gdata::HTTP_SUCCESS, access_token_));
+ } else if (HasRefreshToken()) {
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
@@ -83,22 +83,22 @@ void GDataAuthService::StartAuthenticationOnUIThread(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// We have refresh token, let's gets authenticated.
(new AuthOperation(registry, profile_,
- callback, GetOAuth2RefreshToken()))->Start();
+ callback, refresh_token_))->Start();
}
void GDataAuthService::OnAuthCompleted(
scoped_refptr<base::MessageLoopProxy> relay_proxy,
const AuthStatusCallback& callback,
GDataErrorCode error,
- const std::string& auth_token) {
+ const std::string& access_token) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (error == HTTP_SUCCESS)
- auth_token_ = auth_token;
+ access_token_ = access_token;
// TODO(zelidrag): Add retry, back-off logic when things go wrong here.
if (!callback.is_null())
- relay_proxy->PostTask(FROM_HERE, base::Bind(callback, error, auth_token));
+ relay_proxy->PostTask(FROM_HERE, base::Bind(callback, error, access_token));
}
void GDataAuthService::AddObserver(Observer* observer) {
@@ -120,7 +120,7 @@ void GDataAuthService::Observe(int type,
if (token_details->service() != GaiaConstants::kGaiaOAuth2LoginRefreshToken)
return;
- auth_token_.clear();
+ access_token_.clear();
if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) {
TokenService* service = TokenServiceFactory::GetForProfile(profile_);
refresh_token_ = service->GetOAuth2LoginRefreshToken();
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_auth_service.h ('k') | chrome/browser/chromeos/gdata/gdata_documents_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698