Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_CLIENT_CORE_SESSION_IDENTITY_SOURCE_H_ | 5 #ifndef BLIMP_CLIENT_CORE_SESSION_IDENTITY_SOURCE_H_ |
| 6 #define BLIMP_CLIENT_CORE_SESSION_IDENTITY_SOURCE_H_ | 6 #define BLIMP_CLIENT_CORE_SESSION_IDENTITY_SOURCE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 | 29 |
| 30 explicit IdentitySource(std::unique_ptr<IdentityProvider> identity_provider, | 30 explicit IdentitySource(std::unique_ptr<IdentityProvider> identity_provider, |
| 31 const TokenErrorCallback& error_callback, | 31 const TokenErrorCallback& error_callback, |
| 32 const TokenCallback& callback); | 32 const TokenCallback& callback); |
| 33 ~IdentitySource() override; | 33 ~IdentitySource() override; |
| 34 | 34 |
| 35 // Start Blimp authentication by requesting OAuth2 token from Google. | 35 // Start Blimp authentication by requesting OAuth2 token from Google. |
| 36 // Duplicate connect calls during token fetching will be ignored. | 36 // Duplicate connect calls during token fetching will be ignored. |
| 37 void Connect(); | 37 void Connect(); |
| 38 | 38 |
| 39 // Returns the account name for the current user. | |
|
nyquist
2016/11/08 20:58:59
Could you explain what happens if the user is not
| |
| 40 std::string GetActiveUsername(); | |
| 41 | |
| 39 // Add sign in state observer. | 42 // Add sign in state observer. |
| 40 void AddObserver(IdentityProvider::Observer* observer); | 43 void AddObserver(IdentityProvider::Observer* observer); |
| 41 | 44 |
| 42 // Remove sign in state observer. | 45 // Remove sign in state observer. |
| 43 void RemoveObserver(IdentityProvider::Observer* observer); | 46 void RemoveObserver(IdentityProvider::Observer* observer); |
| 44 | 47 |
| 45 // OAuth2TokenService::Consumer implementation. | 48 // OAuth2TokenService::Consumer implementation. |
| 46 void OnGetTokenSuccess(const OAuth2TokenService::Request* request, | 49 void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
| 47 const std::string& access_token, | 50 const std::string& access_token, |
| 48 const base::Time& expiration_time) override; | 51 const base::Time& expiration_time) override; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 // Current retry count due to request cancellation. | 84 // Current retry count due to request cancellation. |
| 82 int retry_times_; | 85 int retry_times_; |
| 83 | 86 |
| 84 DISALLOW_COPY_AND_ASSIGN(IdentitySource); | 87 DISALLOW_COPY_AND_ASSIGN(IdentitySource); |
| 85 }; | 88 }; |
| 86 | 89 |
| 87 } // namespace client | 90 } // namespace client |
| 88 } // namespace blimp | 91 } // namespace blimp |
| 89 | 92 |
| 90 #endif // BLIMP_CLIENT_CORE_SESSION_IDENTITY_SOURCE_H_ | 93 #endif // BLIMP_CLIENT_CORE_SESSION_IDENTITY_SOURCE_H_ |
| OLD | NEW |