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

Side by Side Diff: chrome/browser/chromeos/gdata/auth_service.cc

Issue 10877006: Rename GDataErrorCode to DriveErrorCode, GDataFileError to DriveFileError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/gdata/auth_service.h" 5 #include "chrome/browser/chromeos/gdata/auth_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 scoped_refptr<base::MessageLoopProxy> relay_proxy, 80 scoped_refptr<base::MessageLoopProxy> relay_proxy,
81 const AuthStatusCallback& callback) { 81 const AuthStatusCallback& callback) {
82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
83 // We have refresh token, let's gets authenticated. 83 // We have refresh token, let's gets authenticated.
84 (new AuthOperation(registry, callback, refresh_token_))->Start(); 84 (new AuthOperation(registry, callback, refresh_token_))->Start();
85 } 85 }
86 86
87 void AuthService::OnAuthCompleted( 87 void AuthService::OnAuthCompleted(
88 scoped_refptr<base::MessageLoopProxy> relay_proxy, 88 scoped_refptr<base::MessageLoopProxy> relay_proxy,
89 const AuthStatusCallback& callback, 89 const AuthStatusCallback& callback,
90 GDataErrorCode error, 90 DriveErrorCode error,
91 const std::string& access_token) { 91 const std::string& access_token) {
92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
93 93
94 if (error == HTTP_SUCCESS) 94 if (error == HTTP_SUCCESS)
95 access_token_ = access_token; 95 access_token_ = access_token;
96 96
97 // TODO(zelidrag): Add retry, back-off logic when things go wrong here. 97 // TODO(zelidrag): Add retry, back-off logic when things go wrong here.
98 if (!callback.is_null()) 98 if (!callback.is_null())
99 relay_proxy->PostTask(FROM_HERE, base::Bind(callback, error, access_token)); 99 relay_proxy->PostTask(FROM_HERE, base::Bind(callback, error, access_token));
100 } 100 }
(...skipping 21 matching lines...) Expand all
122 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) { 122 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) {
123 TokenService* service = TokenServiceFactory::GetForProfile(profile_); 123 TokenService* service = TokenServiceFactory::GetForProfile(profile_);
124 refresh_token_ = service->GetOAuth2LoginRefreshToken(); 124 refresh_token_ = service->GetOAuth2LoginRefreshToken();
125 } else { 125 } else {
126 refresh_token_.clear(); 126 refresh_token_.clear();
127 } 127 }
128 FOR_EACH_OBSERVER(Observer, observers_, OnOAuth2RefreshTokenChanged()); 128 FOR_EACH_OBSERVER(Observer, observers_, OnOAuth2RefreshTokenChanged());
129 } 129 }
130 130
131 } // namespace gdata 131 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698