| 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_SIGNIN_CLIENT_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_SIGNIN_CLIENT_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_SIGNIN_CLIENT_H_ | 6 #define COMPONENTS_SIGNIN_CORE_SIGNIN_CLIENT_H_ |
| 7 | 7 |
| 8 #include "components/signin/core/webdata/token_web_data.h" | 8 #include "components/signin/core/webdata/token_web_data.h" |
| 9 | 9 |
| 10 #if !defined(OS_CHROMEOS) |
| 11 class SigninManager; |
| 12 #endif |
| 13 |
| 10 class TokenWebData; | 14 class TokenWebData; |
| 11 | 15 |
| 12 namespace net { | 16 namespace net { |
| 13 class URLRequestContextGetter; | 17 class URLRequestContextGetter; |
| 14 } | 18 } |
| 15 | 19 |
| 16 // An interface that needs to be supplied to the Signin component by its | 20 // An interface that needs to be supplied to the Signin component by its |
| 17 // embedder. | 21 // embedder. |
| 18 class SigninClient { | 22 class SigninClient { |
| 19 public: | 23 public: |
| 20 virtual ~SigninClient() {} | 24 virtual ~SigninClient() {} |
| 21 | 25 |
| 22 // Gets the TokenWebData instance associated with the client. | 26 // Gets the TokenWebData instance associated with the client. |
| 23 virtual scoped_refptr<TokenWebData> GetDatabase() = 0; | 27 virtual scoped_refptr<TokenWebData> GetDatabase() = 0; |
| 24 | 28 |
| 25 // Returns whether it is possible to revoke credentials. | 29 // Returns whether it is possible to revoke credentials. |
| 26 virtual bool CanRevokeCredentials() = 0; | 30 virtual bool CanRevokeCredentials() = 0; |
| 27 | 31 |
| 28 // Returns the URL request context information associated with the client. | 32 // Returns the URL request context information associated with the client. |
| 29 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; | 33 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; |
| 34 |
| 35 // Called when Google signin has succeeded. |
| 36 virtual void GoogleSigninSucceeded(const std::string& username, |
| 37 const std::string& password) {} |
| 38 |
| 39 #if !defined(OS_CHROMEOS) |
| 40 // Called when |manager| is initialized. |
| 41 virtual void SigninManagerInitialized(SigninManager* manager) {} |
| 42 |
| 43 // Called when |manager| is shut down. |
| 44 virtual void SigninManagerShutdown(SigninManager* manager) {} |
| 45 #endif |
| 30 }; | 46 }; |
| 31 | 47 |
| 32 #endif // COMPONENTS_SIGNIN_CORE_SIGNIN_CLIENT_H_ | 48 #endif // COMPONENTS_SIGNIN_CORE_SIGNIN_CLIENT_H_ |
| OLD | NEW |