OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/signin/core/browser/account_tracker_service.h" | 5 #include "components/signin/core/browser/account_tracker_service.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 const std::string& account_id); | 33 const std::string& account_id); |
34 virtual ~AccountInfoFetcher(); | 34 virtual ~AccountInfoFetcher(); |
35 | 35 |
36 const std::string& account_id() { return account_id_; } | 36 const std::string& account_id() { return account_id_; } |
37 | 37 |
38 void Start(); | 38 void Start(); |
39 | 39 |
40 // OAuth2TokenService::Consumer implementation. | 40 // OAuth2TokenService::Consumer implementation. |
41 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, | 41 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
42 const std::string& access_token, | 42 const std::string& access_token, |
43 const base::Time& expiration_time) OVERRIDE; | 43 const base::Time& expiration_time) override; |
44 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 44 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
45 const GoogleServiceAuthError& error) OVERRIDE; | 45 const GoogleServiceAuthError& error) override; |
46 | 46 |
47 // gaia::GaiaOAuthClient::Delegate implementation. | 47 // gaia::GaiaOAuthClient::Delegate implementation. |
48 virtual void OnGetUserInfoResponse( | 48 virtual void OnGetUserInfoResponse( |
49 scoped_ptr<base::DictionaryValue> user_info) OVERRIDE; | 49 scoped_ptr<base::DictionaryValue> user_info) override; |
50 virtual void OnOAuthError() OVERRIDE; | 50 virtual void OnOAuthError() override; |
51 virtual void OnNetworkError(int response_code) OVERRIDE; | 51 virtual void OnNetworkError(int response_code) override; |
52 | 52 |
53 private: | 53 private: |
54 OAuth2TokenService* token_service_; | 54 OAuth2TokenService* token_service_; |
55 net::URLRequestContextGetter* request_context_getter_; | 55 net::URLRequestContextGetter* request_context_getter_; |
56 AccountTrackerService* service_; | 56 AccountTrackerService* service_; |
57 const std::string account_id_; | 57 const std::string account_id_; |
58 | 58 |
59 scoped_ptr<OAuth2TokenService::Request> login_token_request_; | 59 scoped_ptr<OAuth2TokenService::Request> login_token_request_; |
60 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; | 60 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; |
61 }; | 61 }; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 435 } |
436 } | 436 } |
437 | 437 |
438 void AccountTrackerService::LoadFromTokenService() { | 438 void AccountTrackerService::LoadFromTokenService() { |
439 std::vector<std::string> accounts = token_service_->GetAccounts(); | 439 std::vector<std::string> accounts = token_service_->GetAccounts(); |
440 for (std::vector<std::string>::const_iterator it = accounts.begin(); | 440 for (std::vector<std::string>::const_iterator it = accounts.begin(); |
441 it != accounts.end(); ++it) { | 441 it != accounts.end(); ++it) { |
442 OnRefreshTokenAvailable(*it); | 442 OnRefreshTokenAvailable(*it); |
443 } | 443 } |
444 } | 444 } |
OLD | NEW |