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 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_ACCOUNT_ID_HELPER_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_ACCOUNT_ID_HELPER_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_ACCOUNT_ID_HELPER_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_ACCOUNT_ID_HELPER_H_ |
7 | 7 |
8 #include "components/signin/core/browser/signin_manager.h" | 8 #include "components/signin/core/browser/signin_manager.h" |
9 #include "google_apis/gaia/gaia_oauth_client.h" | 9 #include "google_apis/gaia/gaia_oauth_client.h" |
10 #include "google_apis/gaia/oauth2_token_service.h" | 10 #include "google_apis/gaia/oauth2_token_service.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class SigninAccountIdHelper : public SigninManagerBase::Observer, | 21 class SigninAccountIdHelper : public SigninManagerBase::Observer, |
22 public OAuth2TokenService::Observer { | 22 public OAuth2TokenService::Observer { |
23 public: | 23 public: |
24 SigninAccountIdHelper(SigninClient* client, | 24 SigninAccountIdHelper(SigninClient* client, |
25 ProfileOAuth2TokenService* token_service, | 25 ProfileOAuth2TokenService* token_service, |
26 SigninManagerBase* signin_manager); | 26 SigninManagerBase* signin_manager); |
27 virtual ~SigninAccountIdHelper(); | 27 virtual ~SigninAccountIdHelper(); |
28 | 28 |
29 // SigninManagerBase::Observer: | 29 // SigninManagerBase::Observer: |
30 virtual void GoogleSignedOut(const std::string& account_id, | 30 virtual void GoogleSignedOut(const std::string& account_id, |
31 const std::string& username) OVERRIDE; | 31 const std::string& username) override; |
32 | 32 |
33 // OAuth2TokenService::Observer: | 33 // OAuth2TokenService::Observer: |
34 virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE; | 34 virtual void OnRefreshTokenAvailable(const std::string& account_id) override; |
35 | 35 |
36 // Disables network requests for testing to avoid messing up with irrelevant | 36 // Disables network requests for testing to avoid messing up with irrelevant |
37 // tests. | 37 // tests. |
38 static void SetDisableForTest(bool disable_for_test); | 38 static void SetDisableForTest(bool disable_for_test); |
39 | 39 |
40 private: | 40 private: |
41 // Invoked when receiving the response for |account_id_fetcher_|. | 41 // Invoked when receiving the response for |account_id_fetcher_|. |
42 void OnPrimaryAccountIdFetched(const std::string& gaia_id); | 42 void OnPrimaryAccountIdFetched(const std::string& gaia_id); |
43 | 43 |
44 // Helper class for fetching the obfuscated account ID. | 44 // Helper class for fetching the obfuscated account ID. |
45 class GaiaIdFetcher; | 45 class GaiaIdFetcher; |
46 scoped_ptr<GaiaIdFetcher> id_fetcher_; | 46 scoped_ptr<GaiaIdFetcher> id_fetcher_; |
47 | 47 |
48 static bool disable_for_test_; | 48 static bool disable_for_test_; |
49 | 49 |
50 SigninClient* client_; | 50 SigninClient* client_; |
51 ProfileOAuth2TokenService* token_service_; | 51 ProfileOAuth2TokenService* token_service_; |
52 SigninManagerBase* signin_manager_; | 52 SigninManagerBase* signin_manager_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(SigninAccountIdHelper); | 54 DISALLOW_COPY_AND_ASSIGN(SigninAccountIdHelper); |
55 }; | 55 }; |
56 | 56 |
57 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_ACCOUNT_ID_HELPER_H_ | 57 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_ACCOUNT_ID_HELPER_H_ |
OLD | NEW |