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

Unified Diff: chrome/browser/google_apis/auth_service.cc

Issue 19511002: Change google_api::RequestSender to take an AuthService instead of a Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/google_apis/auth_service.h ('k') | chrome/browser/google_apis/auth_service_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/auth_service.cc
diff --git a/chrome/browser/google_apis/auth_service.cc b/chrome/browser/google_apis/auth_service.cc
index ff492bb683711132e3f98a210828a8a417644a80..7d2017a5ffb376405fb8c8c2796f1b0a299f9a03 100644
--- a/chrome/browser/google_apis/auth_service.cc
+++ b/chrome/browser/google_apis/auth_service.cc
@@ -137,8 +137,16 @@ void AuthRequest::OnGetTokenFailure(const GoogleServiceAuthError& error) {
delete this;
}
-void AuthService::Initialize(Profile* profile) {
- profile_ = profile;
+AuthService::AuthService(
+ Profile* profile,
+ net::URLRequestContextGetter* url_request_context_getter,
+ const std::vector<std::string>& scopes)
+ : profile_(profile),
+ url_request_context_getter_(url_request_context_getter),
+ scopes_(scopes),
+ weak_ptr_factory_(this) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
// Get OAuth2 refresh token (if we have any) and register for its updates.
TokenService* service = TokenServiceFactory::GetForProfile(profile_);
refresh_token_ = service->GetOAuth2LoginRefreshToken();
@@ -148,21 +156,6 @@ void AuthService::Initialize(Profile* profile) {
registrar_.Add(this,
chrome::NOTIFICATION_TOKEN_REQUEST_FAILED,
content::Source<TokenService>(service));
-
- if (!refresh_token_.empty())
- FOR_EACH_OBSERVER(AuthServiceObserver,
- observers_,
- OnOAuth2RefreshTokenChanged());
-}
-
-AuthService::AuthService(
- net::URLRequestContextGetter* url_request_context_getter,
- const std::vector<std::string>& scopes)
- : profile_(NULL),
- url_request_context_getter_(url_request_context_getter),
- scopes_(scopes),
- weak_ptr_factory_(this) {
- DCHECK(thread_checker_.CalledOnValidThread());
}
AuthService::~AuthService() {
« no previous file with comments | « chrome/browser/google_apis/auth_service.h ('k') | chrome/browser/google_apis/auth_service_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698