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_CLIENT_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "components/keyed_service/core/keyed_service.h" |
9 #include "components/signin/core/browser/webdata/token_web_data.h" | 10 #include "components/signin/core/browser/webdata/token_web_data.h" |
10 | 11 |
11 class PrefService; | 12 class PrefService; |
12 class SigninManagerBase; | 13 class SigninManagerBase; |
13 class TokenWebData; | 14 class TokenWebData; |
14 | 15 |
15 namespace net { | 16 namespace net { |
16 class CanonicalCookie; | 17 class CanonicalCookie; |
17 class URLRequestContextGetter; | 18 class URLRequestContextGetter; |
18 } | 19 } |
19 | 20 |
20 #if defined(OS_IOS) | 21 #if defined(OS_IOS) |
21 namespace ios { | 22 namespace ios { |
22 // TODO(msarda): http://crbug.com/358544 Remove this iOS specific code from the | 23 // TODO(msarda): http://crbug.com/358544 Remove this iOS specific code from the |
23 // core SigninClient. | 24 // core SigninClient. |
24 class ProfileOAuth2TokenServiceIOSProvider; | 25 class ProfileOAuth2TokenServiceIOSProvider; |
25 } | 26 } |
26 #endif | 27 #endif |
27 | 28 |
28 // An interface that needs to be supplied to the Signin component by its | 29 // An interface that needs to be supplied to the Signin component by its |
29 // embedder. | 30 // embedder. |
30 class SigninClient { | 31 class SigninClient : public KeyedService { |
31 public: | 32 public: |
32 typedef base::Callback<void(const net::CanonicalCookie* cookie)> | 33 typedef base::Callback<void(const net::CanonicalCookie* cookie)> |
33 CookieChangedCallback; | 34 CookieChangedCallback; |
34 | 35 |
35 virtual ~SigninClient() {} | 36 virtual ~SigninClient() {} |
36 | 37 |
37 // Gets the preferences associated with the client. | 38 // Gets the preferences associated with the client. |
38 virtual PrefService* GetPrefs() = 0; | 39 virtual PrefService* GetPrefs() = 0; |
39 | 40 |
40 // Gets the TokenWebData instance associated with the client. | 41 // Gets the TokenWebData instance associated with the client. |
(...skipping 18 matching lines...) Expand all Loading... |
59 // TODO(blundell): Eliminate this interface in favor of having core signin | 60 // TODO(blundell): Eliminate this interface in favor of having core signin |
60 // code observe cookie changes once //chrome/browser/net has been | 61 // code observe cookie changes once //chrome/browser/net has been |
61 // componentized. | 62 // componentized. |
62 virtual void SetCookieChangedCallback( | 63 virtual void SetCookieChangedCallback( |
63 const CookieChangedCallback& callback) = 0; | 64 const CookieChangedCallback& callback) = 0; |
64 | 65 |
65 // Called when Google signin has succeeded. | 66 // Called when Google signin has succeeded. |
66 virtual void GoogleSigninSucceeded(const std::string& username, | 67 virtual void GoogleSigninSucceeded(const std::string& username, |
67 const std::string& password) {} | 68 const std::string& password) {} |
68 | 69 |
| 70 virtual void SetSigninProcess(int host_id) = 0; |
| 71 virtual void ClearSigninProcess() = 0; |
| 72 virtual bool IsSigninProcess(int host_id) const = 0; |
| 73 virtual bool HasSigninProcess() const = 0; |
| 74 |
| 75 |
69 #if defined(OS_IOS) | 76 #if defined(OS_IOS) |
70 // TODO(msarda): http://crbug.com/358544 Remove this iOS specific code from | 77 // TODO(msarda): http://crbug.com/358544 Remove this iOS specific code from |
71 // the core SigninClient. | 78 // the core SigninClient. |
72 virtual ios::ProfileOAuth2TokenServiceIOSProvider* GetIOSProvider() = 0; | 79 virtual ios::ProfileOAuth2TokenServiceIOSProvider* GetIOSProvider() = 0; |
73 #endif | 80 #endif |
74 }; | 81 }; |
75 | 82 |
76 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ | 83 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ |
OLD | NEW |