| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // signs-in and an OAuth2 login refresh token becomes available. | 104 // signs-in and an OAuth2 login refresh token becomes available. |
| 105 void InitializeForSignedInUser(const std::string& username); | 105 void InitializeForSignedInUser(const std::string& username); |
| 106 | 106 |
| 107 // Initializes the cloud policy manager with the passed |client|. This is | 107 // Initializes the cloud policy manager with the passed |client|. This is |
| 108 // called from InitializeForSignedInUser() when the Profile already has a | 108 // called from InitializeForSignedInUser() when the Profile already has a |
| 109 // signed in account at startup, and from FetchPolicyForSignedInUser() during | 109 // signed in account at startup, and from FetchPolicyForSignedInUser() during |
| 110 // the initial policy fetch after signing in. | 110 // the initial policy fetch after signing in. |
| 111 virtual void InitializeUserCloudPolicyManager( | 111 virtual void InitializeUserCloudPolicyManager( |
| 112 scoped_ptr<CloudPolicyClient> client); | 112 scoped_ptr<CloudPolicyClient> client); |
| 113 | 113 |
| 114 // Prepares for the UserCloudPolicyManager to be shutdown due to |
| 115 // user signout or profile destruction. |
| 116 virtual void PrepareForUserCloudPolicyManagerShutdown(); |
| 117 |
| 114 // Shuts down the UserCloudPolicyManager (for example, after the user signs | 118 // Shuts down the UserCloudPolicyManager (for example, after the user signs |
| 115 // out) and deletes any cached policy. | 119 // out) and deletes any cached policy. |
| 116 virtual void ShutdownUserCloudPolicyManager(); | 120 virtual void ShutdownUserCloudPolicyManager(); |
| 117 | 121 |
| 118 // Convenience helper to get the UserCloudPolicyManager for |profile_|. | 122 // Convenience helper to get the UserCloudPolicyManager for |profile_|. |
| 119 UserCloudPolicyManager* GetManager(); | 123 UserCloudPolicyManager* GetManager(); |
| 120 | 124 |
| 121 Profile* profile() { return profile_; } | 125 Profile* profile() { return profile_; } |
| 122 content::NotificationRegistrar* registrar() { return ®istrar_; } | 126 content::NotificationRegistrar* registrar() { return ®istrar_; } |
| 123 | 127 |
| 124 private: | 128 private: |
| 125 // Weak pointer to the profile this service is associated with. | 129 // Weak pointer to the profile this service is associated with. |
| 126 Profile* profile_; | 130 Profile* profile_; |
| 127 | 131 |
| 128 content::NotificationRegistrar registrar_; | 132 content::NotificationRegistrar registrar_; |
| 129 | 133 |
| 130 base::WeakPtrFactory<UserPolicySigninServiceBase> weak_factory_; | 134 base::WeakPtrFactory<UserPolicySigninServiceBase> weak_factory_; |
| 131 | 135 |
| 132 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninServiceBase); | 136 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninServiceBase); |
| 133 }; | 137 }; |
| 134 | 138 |
| 135 } // namespace policy | 139 } // namespace policy |
| 136 | 140 |
| 137 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ | 141 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ |
| OLD | NEW |