| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ |
| 6 #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 Profile* profile, | 63 Profile* profile, |
| 64 PrefService* local_state, | 64 PrefService* local_state, |
| 65 scoped_refptr<net::URLRequestContextGetter> request_context, | 65 scoped_refptr<net::URLRequestContextGetter> request_context, |
| 66 DeviceManagementService* device_management_service); | 66 DeviceManagementService* device_management_service); |
| 67 virtual ~UserPolicySigninServiceBase(); | 67 virtual ~UserPolicySigninServiceBase(); |
| 68 | 68 |
| 69 // Initiates a policy fetch as part of user signin, using a CloudPolicyClient | 69 // Initiates a policy fetch as part of user signin, using a CloudPolicyClient |
| 70 // previously initialized via RegisterPolicyClient. |callback| is invoked | 70 // previously initialized via RegisterPolicyClient. |callback| is invoked |
| 71 // once the policy fetch is complete, passing true if the policy fetch | 71 // once the policy fetch is complete, passing true if the policy fetch |
| 72 // succeeded. | 72 // succeeded. |
| 73 void FetchPolicyForSignedInUser(scoped_ptr<CloudPolicyClient> client, | 73 void FetchPolicyForSignedInUser(const std::string& username, |
| 74 scoped_ptr<CloudPolicyClient> client, |
| 74 const PolicyFetchCallback& callback); | 75 const PolicyFetchCallback& callback); |
| 75 | 76 |
| 76 // content::NotificationObserver implementation: | 77 // content::NotificationObserver implementation: |
| 77 virtual void Observe(int type, | 78 virtual void Observe(int type, |
| 78 const content::NotificationSource& source, | 79 const content::NotificationSource& source, |
| 79 const content::NotificationDetails& details) OVERRIDE; | 80 const content::NotificationDetails& details) OVERRIDE; |
| 80 | 81 |
| 81 // CloudPolicyService::Observer implementation: | 82 // CloudPolicyService::Observer implementation: |
| 82 virtual void OnInitializationCompleted(CloudPolicyService* service) OVERRIDE; | 83 virtual void OnInitializationCompleted(CloudPolicyService* service) OVERRIDE; |
| 83 | 84 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 114 // from InitializeOnProfileReady() if the Profile already has a signed-in | 115 // from InitializeOnProfileReady() if the Profile already has a signed-in |
| 115 // account at startup, or (on the desktop platforms) as soon as the user | 116 // account at startup, or (on the desktop platforms) as soon as the user |
| 116 // signs-in and an OAuth2 login refresh token becomes available. | 117 // signs-in and an OAuth2 login refresh token becomes available. |
| 117 void InitializeForSignedInUser(const std::string& username); | 118 void InitializeForSignedInUser(const std::string& username); |
| 118 | 119 |
| 119 // Initializes the cloud policy manager with the passed |client|. This is | 120 // Initializes the cloud policy manager with the passed |client|. This is |
| 120 // called from InitializeForSignedInUser() when the Profile already has a | 121 // called from InitializeForSignedInUser() when the Profile already has a |
| 121 // signed in account at startup, and from FetchPolicyForSignedInUser() during | 122 // signed in account at startup, and from FetchPolicyForSignedInUser() during |
| 122 // the initial policy fetch after signing in. | 123 // the initial policy fetch after signing in. |
| 123 virtual void InitializeUserCloudPolicyManager( | 124 virtual void InitializeUserCloudPolicyManager( |
| 125 const std::string& username, |
| 124 scoped_ptr<CloudPolicyClient> client); | 126 scoped_ptr<CloudPolicyClient> client); |
| 125 | 127 |
| 126 // Prepares for the UserCloudPolicyManager to be shutdown due to | 128 // Prepares for the UserCloudPolicyManager to be shutdown due to |
| 127 // user signout or profile destruction. | 129 // user signout or profile destruction. |
| 128 virtual void PrepareForUserCloudPolicyManagerShutdown(); | 130 virtual void PrepareForUserCloudPolicyManagerShutdown(); |
| 129 | 131 |
| 130 // Shuts down the UserCloudPolicyManager (for example, after the user signs | 132 // Shuts down the UserCloudPolicyManager (for example, after the user signs |
| 131 // out) and deletes any cached policy. | 133 // out) and deletes any cached policy. |
| 132 virtual void ShutdownUserCloudPolicyManager(); | 134 virtual void ShutdownUserCloudPolicyManager(); |
| 133 | 135 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 149 DeviceManagementService* device_management_service_; | 151 DeviceManagementService* device_management_service_; |
| 150 | 152 |
| 151 base::WeakPtrFactory<UserPolicySigninServiceBase> weak_factory_; | 153 base::WeakPtrFactory<UserPolicySigninServiceBase> weak_factory_; |
| 152 | 154 |
| 153 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninServiceBase); | 155 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninServiceBase); |
| 154 }; | 156 }; |
| 155 | 157 |
| 156 } // namespace policy | 158 } // namespace policy |
| 157 | 159 |
| 158 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ | 160 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ |
| OLD | NEW |