| 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_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // the request changes or is cleared. When the request completes, | 25 // the request changes or is cleared. When the request completes, |
| 26 // Consumer::OnGetTokenSuccess will be invoked, but the access token | 26 // Consumer::OnGetTokenSuccess will be invoked, but the access token |
| 27 // won't be cached. | 27 // won't be cached. |
| 28 // | 28 // |
| 29 // Note: requests should be started from the UI thread. To start a | 29 // Note: requests should be started from the UI thread. To start a |
| 30 // request from other thread, please use OAuth2TokenServiceRequest. | 30 // request from other thread, please use OAuth2TokenServiceRequest. |
| 31 class ProfileOAuth2TokenService : public OAuth2TokenService, | 31 class ProfileOAuth2TokenService : public OAuth2TokenService, |
| 32 public OAuth2TokenService::Observer, | 32 public OAuth2TokenService::Observer, |
| 33 public KeyedService { | 33 public KeyedService { |
| 34 public: | 34 public: |
| 35 ProfileOAuth2TokenService(OAuth2TokenServiceDelegate* delegate); | 35 ProfileOAuth2TokenService( |
| 36 std::unique_ptr<OAuth2TokenServiceDelegate> delegate); |
| 36 ~ProfileOAuth2TokenService() override; | 37 ~ProfileOAuth2TokenService() override; |
| 37 | 38 |
| 38 // KeyedService implementation. | 39 // KeyedService implementation. |
| 39 void Shutdown() override; | 40 void Shutdown() override; |
| 40 | 41 |
| 41 // Loads credentials from a backing persistent store to make them available | 42 // Loads credentials from a backing persistent store to make them available |
| 42 // after service is used between profile restarts. | 43 // after service is used between profile restarts. |
| 43 // | 44 // |
| 44 // Only call this method if there is at least one account connected to the | 45 // Only call this method if there is at least one account connected to the |
| 45 // profile, otherwise startup will cause unneeded work on the IO thread. The | 46 // profile, otherwise startup will cause unneeded work on the IO thread. The |
| (...skipping 15 matching lines...) Expand all Loading... |
| 61 const net::BackoffEntry* GetDelegateBackoffEntry(); | 62 const net::BackoffEntry* GetDelegateBackoffEntry(); |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 void OnRefreshTokenAvailable(const std::string& account_id) override; | 65 void OnRefreshTokenAvailable(const std::string& account_id) override; |
| 65 void OnRefreshTokenRevoked(const std::string& account_id) override; | 66 void OnRefreshTokenRevoked(const std::string& account_id) override; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService); | 68 DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 71 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| OLD | NEW |