| 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_CLOUD_POLICY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_MANAGER_H_ |
| 6 #define CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_MANAGER_H_ | 6 #define CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // UserCloudPolicyManager handles initialization of user policy for Chrome | 23 // UserCloudPolicyManager handles initialization of user policy for Chrome |
| 24 // Profiles on the desktop platforms. | 24 // Profiles on the desktop platforms. |
| 25 class UserCloudPolicyManager : public CloudPolicyManager { | 25 class UserCloudPolicyManager : public CloudPolicyManager { |
| 26 public: | 26 public: |
| 27 UserCloudPolicyManager(Profile* profile, | 27 UserCloudPolicyManager(Profile* profile, |
| 28 scoped_ptr<UserCloudPolicyStore> store); | 28 scoped_ptr<UserCloudPolicyStore> store); |
| 29 virtual ~UserCloudPolicyManager(); | 29 virtual ~UserCloudPolicyManager(); |
| 30 | 30 |
| 31 // Initializes the cloud connection. |local_state| and | 31 // Initializes the cloud connection. |local_state| and |
| 32 // |device_management_service| must stay valid until this object is deleted or | 32 // |device_management_service| must stay valid until this object is deleted or |
| 33 // ShutdownAndRemovePolicy() gets called. Virtual for mocking. | 33 // DisconnectAndRemovePolicy() gets called. Virtual for mocking. |
| 34 virtual void Connect(PrefService* local_state, | 34 virtual void Connect(PrefService* local_state, |
| 35 DeviceManagementService* device_management_service); | 35 DeviceManagementService* device_management_service); |
| 36 | 36 |
| 37 // Shuts down the UserCloudPolicyManager (removes and stops refreshing the | 37 // Shuts down the UserCloudPolicyManager (removes and stops refreshing the |
| 38 // cached cloud policy). This is typically called when a profile is being | 38 // cached cloud policy). This is typically called when a profile is being |
| 39 // disassociated from a given user (e.g. during signout). No policy will be | 39 // disassociated from a given user (e.g. during signout). No policy will be |
| 40 // provided by this object until the next time Initialize() is invoked. | 40 // provided by this object until the next time Initialize() is invoked. |
| 41 void DisconnectAndRemovePolicy(); | 41 void DisconnectAndRemovePolicy(); |
| 42 | 42 |
| 43 // Returns true if the underlying CloudPolicyClient is already registered. | 43 // Returns true if the underlying CloudPolicyClient is already registered. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 54 // Typed pointer to the store owned by UserCloudPolicyManager. Note that | 54 // Typed pointer to the store owned by UserCloudPolicyManager. Note that |
| 55 // CloudPolicyManager only keeps a plain CloudPolicyStore pointer. | 55 // CloudPolicyManager only keeps a plain CloudPolicyStore pointer. |
| 56 scoped_ptr<UserCloudPolicyStore> store_; | 56 scoped_ptr<UserCloudPolicyStore> store_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManager); | 58 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManager); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace policy | 61 } // namespace policy |
| 62 | 62 |
| 63 #endif // CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_MANAGER_H_ | 63 #endif // CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_MANAGER_H_ |
| OLD | NEW |