Index: chrome/browser/policy/cloud/user_cloud_policy_manager.cc |
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager.cc |
index 86d01aa8693754b1b7f8d29fe9acf038fdf21e8a..e77aec76bbc8655eef386288ad3250ba38c4ea19 100644 |
--- a/chrome/browser/policy/cloud/user_cloud_policy_manager.cc |
+++ b/chrome/browser/policy/cloud/user_cloud_policy_manager.cc |
@@ -66,6 +66,7 @@ void UserCloudPolicyManager::Connect( |
policy_prefs::kUserPolicyRefreshRate); |
if (external_data_manager_) |
external_data_manager_->Connect(request_context); |
+ |
CreateComponentCloudPolicyService(component_policy_cache_path_, |
request_context); |
} |
@@ -84,6 +85,12 @@ void UserCloudPolicyManager::DisconnectAndRemovePolicy() { |
if (external_data_manager_) |
external_data_manager_->Disconnect(); |
core()->Disconnect(); |
+ |
+ // store_->Clear() will publish the updated, empty policy. The component |
+ // policy service must be cleared before OnStoreLoaded() is issued, so that |
+ // component policies are also empty at CheckAndPublishPolicy(). |
+ ClearAndDestroyComponentCloudPolicyService(); |
+ |
// When the |store_| is cleared, it informs the |external_data_manager_| that |
// all external data references have been removed, causing the |
// |external_data_manager_| to clear its cache as well. |