| 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 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 store_.get(), | 139 store_.get(), |
| 140 cache_root_dir.Append( | 140 cache_root_dir.Append( |
| 141 GetCacheSubdirectoryForAccountID(account.account_id))); | 141 GetCacheSubdirectoryForAccountID(account.account_id))); |
| 142 store_->AddObserver(this); | 142 store_->AddObserver(this); |
| 143 | 143 |
| 144 // Unblock the |schema_registry_| so that the |component_policy_service_| | 144 // Unblock the |schema_registry_| so that the |component_policy_service_| |
| 145 // starts using it. | 145 // starts using it. |
| 146 schema_registry_.RegisterComponent( | 146 schema_registry_.RegisterComponent( |
| 147 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()), | 147 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()), |
| 148 g_browser_process->browser_policy_connector()->GetChromeSchema()); | 148 g_browser_process->browser_policy_connector()->GetChromeSchema()); |
| 149 schema_registry_.SetReady(POLICY_DOMAIN_CHROME); | 149 schema_registry_.SetAllDomainsReady(); |
| 150 schema_registry_.SetReady(POLICY_DOMAIN_EXTENSIONS); | |
| 151 } | 150 } |
| 152 | 151 |
| 153 DeviceLocalAccountPolicyBroker::~DeviceLocalAccountPolicyBroker() { | 152 DeviceLocalAccountPolicyBroker::~DeviceLocalAccountPolicyBroker() { |
| 154 store_->RemoveObserver(this); | 153 store_->RemoveObserver(this); |
| 155 external_data_manager_->SetPolicyStore(nullptr); | 154 external_data_manager_->SetPolicyStore(nullptr); |
| 156 external_data_manager_->Disconnect(); | 155 external_data_manager_->Disconnect(); |
| 157 } | 156 } |
| 158 | 157 |
| 159 void DeviceLocalAccountPolicyBroker::Initialize() { | 158 void DeviceLocalAccountPolicyBroker::Initialize() { |
| 160 store_->Load(); | 159 store_->Load(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // Disabled via the command line. | 226 // Disabled via the command line. |
| 228 return; | 227 return; |
| 229 } | 228 } |
| 230 | 229 |
| 231 std::unique_ptr<ResourceCache> resource_cache( | 230 std::unique_ptr<ResourceCache> resource_cache( |
| 232 new ResourceCache(component_policy_cache_path_, | 231 new ResourceCache(component_policy_cache_path_, |
| 233 content::BrowserThread::GetTaskRunnerForThread( | 232 content::BrowserThread::GetTaskRunnerForThread( |
| 234 content::BrowserThread::FILE))); | 233 content::BrowserThread::FILE))); |
| 235 | 234 |
| 236 component_policy_service_.reset(new ComponentCloudPolicyService( | 235 component_policy_service_.reset(new ComponentCloudPolicyService( |
| 237 this, &schema_registry_, core(), client, std::move(resource_cache), | 236 dm_protocol::kChromeExtensionPolicyType, this, &schema_registry_, core(), |
| 238 request_context, content::BrowserThread::GetTaskRunnerForThread( | 237 client, std::move(resource_cache), request_context, |
| 239 content::BrowserThread::FILE), | 238 content::BrowserThread::GetTaskRunnerForThread( |
| 239 content::BrowserThread::FILE), |
| 240 content::BrowserThread::GetTaskRunnerForThread( | 240 content::BrowserThread::GetTaskRunnerForThread( |
| 241 content::BrowserThread::IO))); | 241 content::BrowserThread::IO))); |
| 242 } | 242 } |
| 243 | 243 |
| 244 DeviceLocalAccountPolicyService::DeviceLocalAccountPolicyService( | 244 DeviceLocalAccountPolicyService::DeviceLocalAccountPolicyService( |
| 245 chromeos::SessionManagerClient* session_manager_client, | 245 chromeos::SessionManagerClient* session_manager_client, |
| 246 chromeos::DeviceSettingsService* device_settings_service, | 246 chromeos::DeviceSettingsService* device_settings_service, |
| 247 chromeos::CrosSettings* cros_settings, | 247 chromeos::CrosSettings* cros_settings, |
| 248 AffiliatedInvalidationServiceProvider* invalidation_service_provider, | 248 AffiliatedInvalidationServiceProvider* invalidation_service_provider, |
| 249 scoped_refptr<base::SequencedTaskRunner> store_background_task_runner, | 249 scoped_refptr<base::SequencedTaskRunner> store_background_task_runner, |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 return nullptr; | 565 return nullptr; |
| 566 } | 566 } |
| 567 | 567 |
| 568 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated( | 568 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated( |
| 569 const std::string& user_id) { | 569 const std::string& user_id) { |
| 570 for (auto& observer : observers_) | 570 for (auto& observer : observers_) |
| 571 observer.OnPolicyUpdated(user_id); | 571 observer.OnPolicyUpdated(user_id); |
| 572 } | 572 } |
| 573 | 573 |
| 574 } // namespace policy | 574 } // namespace policy |
| OLD | NEW |