OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_FETCHER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_FETCHER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_FETCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void OnGetTokenSuccess(const OAuth2TokenService::Request* request, | 51 void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
52 const std::string& access_token, | 52 const std::string& access_token, |
53 const base::Time& expiration_time) override; | 53 const base::Time& expiration_time) override; |
54 void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 54 void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
55 const GoogleServiceAuthError& error) override; | 55 const GoogleServiceAuthError& error) override; |
56 | 56 |
57 // GaiaOAuthClient::Delegate overrides: | 57 // GaiaOAuthClient::Delegate overrides: |
58 void OnOAuthError() override; | 58 void OnOAuthError() override; |
59 void OnNetworkError(int response_code) override; | 59 void OnNetworkError(int response_code) override; |
60 void OnGetTokenInfoResponse( | 60 void OnGetTokenInfoResponse( |
61 scoped_ptr<base::DictionaryValue> token_info) override; | 61 std::unique_ptr<base::DictionaryValue> token_info) override; |
62 | 62 |
63 void RequestAccessToken(const std::string& user_email); | 63 void RequestAccessToken(const std::string& user_email); |
64 void FillForAccessToken(const std::string& access_token); | 64 void FillForAccessToken(const std::string& access_token); |
65 | 65 |
66 // This is called before profile is detroyed. | 66 // This is called before profile is detroyed. |
67 void OnProfileDestroyed(); | 67 void OnProfileDestroyed(); |
68 | 68 |
69 TokenHandleUtil* token_handle_util_ = nullptr; | 69 TokenHandleUtil* token_handle_util_ = nullptr; |
70 AccountId account_id_; | 70 AccountId account_id_; |
71 OAuth2TokenService* token_service_ = nullptr; | 71 OAuth2TokenService* token_service_ = nullptr; |
72 | 72 |
73 bool waiting_for_refresh_token_ = false; | 73 bool waiting_for_refresh_token_ = false; |
74 std::string account_without_token_; | 74 std::string account_without_token_; |
75 Profile* profile_ = nullptr; | 75 Profile* profile_ = nullptr; |
76 base::TimeTicks tokeninfo_response_start_time_ = base::TimeTicks(); | 76 base::TimeTicks tokeninfo_response_start_time_ = base::TimeTicks(); |
77 TokenFetchingCallback callback_; | 77 TokenFetchingCallback callback_; |
78 scoped_ptr<gaia::GaiaOAuthClient> gaia_client_; | 78 std::unique_ptr<gaia::GaiaOAuthClient> gaia_client_; |
79 scoped_ptr<OAuth2TokenService::Request> oauth2_access_token_request_; | 79 std::unique_ptr<OAuth2TokenService::Request> oauth2_access_token_request_; |
80 scoped_ptr<KeyedServiceShutdownNotifier::Subscription> | 80 std::unique_ptr<KeyedServiceShutdownNotifier::Subscription> |
81 profile_shutdown_notification_; | 81 profile_shutdown_notification_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(TokenHandleFetcher); | 83 DISALLOW_COPY_AND_ASSIGN(TokenHandleFetcher); |
84 }; | 84 }; |
85 | 85 |
86 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_FETCHER_H_ | 86 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_FETCHER_H_ |
OLD | NEW |