| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_USER_POLICY_SIGNIN_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_USER_POLICY_SIGNIN_SERVICE_H_ |
| 6 #define CHROME_BROWSER_POLICY_USER_POLICY_SIGNIN_SERVICE_H_ | 6 #define CHROME_BROWSER_POLICY_USER_POLICY_SIGNIN_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 // Fetches an OAuth token to allow the cloud policy service to register with | 98 // Fetches an OAuth token to allow the cloud policy service to register with |
| 99 // the cloud policy server. |oauth_login_token| should contain an OAuth login | 99 // the cloud policy server. |oauth_login_token| should contain an OAuth login |
| 100 // refresh token that can be downscoped to get an access token for the | 100 // refresh token that can be downscoped to get an access token for the |
| 101 // device_management service. | 101 // device_management service. |
| 102 void RegisterCloudPolicyService(std::string oauth_login_token); | 102 void RegisterCloudPolicyService(std::string oauth_login_token); |
| 103 | 103 |
| 104 // Callback invoked when policy registration has finished. | 104 // Callback invoked when policy registration has finished. |
| 105 void OnRegistrationComplete(); | 105 void OnRegistrationComplete(); |
| 106 | 106 |
| 107 // Helper routine which prohibits user signout if the user is registered for |
| 108 // cloud policy. |
| 109 void ProhibitSignoutIfNeeded(); |
| 110 |
| 107 // Helper routines to (un)register for CloudPolicyService and | 111 // Helper routines to (un)register for CloudPolicyService and |
| 108 // CloudPolicyClient notifications. | 112 // CloudPolicyClient notifications. |
| 109 void StartObserving(); | 113 void StartObserving(); |
| 110 void StopObserving(); | 114 void StopObserving(); |
| 111 | 115 |
| 112 // Shuts down the UserCloudPolicyManager (for example, after the user signs | 116 // Shuts down the UserCloudPolicyManager (for example, after the user signs |
| 113 // out) and deletes any cached policy. | 117 // out) and deletes any cached policy. |
| 114 void ShutdownUserCloudPolicyManager(); | 118 void ShutdownUserCloudPolicyManager(); |
| 115 | 119 |
| 116 // Invoked when a policy registration request is complete. | 120 // Invoked when a policy registration request is complete. |
| 117 void CallPolicyRegistrationCallback(scoped_ptr<CloudPolicyClient> client, | 121 void CallPolicyRegistrationCallback(scoped_ptr<CloudPolicyClient> client, |
| 118 PolicyRegistrationCallback callback); | 122 PolicyRegistrationCallback callback); |
| 119 | 123 |
| 120 // Convenience helper to get the UserCloudPolicyManager for |profile_|. | 124 // Convenience helper to get the UserCloudPolicyManager for |profile_|. |
| 121 UserCloudPolicyManager* GetManager(); | 125 UserCloudPolicyManager* GetManager(); |
| 122 | 126 |
| 123 // Weak pointer to the profile this service is associated with. | 127 // Weak pointer to the profile this service is associated with. |
| 124 Profile* profile_; | 128 Profile* profile_; |
| 125 | 129 |
| 126 content::NotificationRegistrar registrar_; | 130 content::NotificationRegistrar registrar_; |
| 127 | 131 |
| 128 scoped_ptr<CloudPolicyClientRegistrationHelper> registration_helper_; | 132 scoped_ptr<CloudPolicyClientRegistrationHelper> registration_helper_; |
| 129 | 133 |
| 130 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninService); | 134 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninService); |
| 131 }; | 135 }; |
| 132 | 136 |
| 133 } // namespace policy | 137 } // namespace policy |
| 134 | 138 |
| 135 #endif // CHROME_BROWSER_POLICY_USER_POLICY_SIGNIN_SERVICE_H_ | 139 #endif // CHROME_BROWSER_POLICY_USER_POLICY_SIGNIN_SERVICE_H_ |
| OLD | NEW |