| 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/policy/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/message_loop/message_loop_proxy.h" | 16 #include "base/message_loop/message_loop_proxy.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/prefs/pref_registry_simple.h" | 18 #include "base/prefs/pref_registry_simple.h" |
| 19 #include "base/prefs/pref_service.h" | 19 #include "base/prefs/pref_service.h" |
| 20 #include "base/sequenced_task_runner.h" | 20 #include "base/sequenced_task_runner.h" |
| 21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
| 22 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
| 23 #include "base/strings/sys_string_conversions.h" | 23 #include "base/strings/sys_string_conversions.h" |
| 24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 25 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
| 26 #include "base/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
| 27 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
| 28 #include "chrome/browser/policy/configuration_policy_handler_list_factory.h" | 28 #include "chrome/browser/policy/configuration_policy_handler_list_factory.h" |
| 29 #include "chrome/browser/policy/policy_transformations.h" | |
| 30 #include "chrome/common/chrome_paths.h" | 29 #include "chrome/common/chrome_paths.h" |
| 31 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
| 32 #include "chrome/common/chrome_version_info.h" | 31 #include "chrome/common/chrome_version_info.h" |
| 33 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
| 34 #include "components/policy/core/common/async_policy_provider.h" | 33 #include "components/policy/core/common/async_policy_provider.h" |
| 35 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 34 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
| 36 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" | 35 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" |
| 37 #include "components/policy/core/common/cloud/cloud_policy_service.h" | 36 #include "components/policy/core/common/cloud/cloud_policy_service.h" |
| 38 #include "components/policy/core/common/cloud/device_management_service.h" | 37 #include "components/policy/core/common/cloud/device_management_service.h" |
| 39 #include "components/policy/core/common/configuration_policy_provider.h" | 38 #include "components/policy/core/common/configuration_policy_provider.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 providers.push_back(g_testing_provider); | 390 providers.push_back(g_testing_provider); |
| 392 } else { | 391 } else { |
| 393 if (platform_provider_) | 392 if (platform_provider_) |
| 394 providers.push_back(platform_provider_.get()); | 393 providers.push_back(platform_provider_.get()); |
| 395 #if defined(OS_CHROMEOS) | 394 #if defined(OS_CHROMEOS) |
| 396 if (device_cloud_policy_manager_) | 395 if (device_cloud_policy_manager_) |
| 397 providers.push_back(device_cloud_policy_manager_.get()); | 396 providers.push_back(device_cloud_policy_manager_.get()); |
| 398 providers.push_back(&global_user_cloud_policy_provider_); | 397 providers.push_back(&global_user_cloud_policy_provider_); |
| 399 #endif | 398 #endif |
| 400 } | 399 } |
| 401 policy_service_.reset(new PolicyServiceImpl( | 400 policy_service_.reset(new PolicyServiceImpl(providers)); |
| 402 providers, base::Bind(&policy::FixDeprecatedPolicies))); | |
| 403 } | 401 } |
| 404 return policy_service_.get(); | 402 return policy_service_.get(); |
| 405 } | 403 } |
| 406 | 404 |
| 407 const Schema& BrowserPolicyConnector::GetChromeSchema() const { | 405 const Schema& BrowserPolicyConnector::GetChromeSchema() const { |
| 408 return chrome_schema_; | 406 return chrome_schema_; |
| 409 } | 407 } |
| 410 | 408 |
| 411 CombinedSchemaRegistry* BrowserPolicyConnector::GetSchemaRegistry() { | 409 CombinedSchemaRegistry* BrowserPolicyConnector::GetSchemaRegistry() { |
| 412 return &schema_registry_; | 410 return &schema_registry_; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 601 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); |
| 604 } else { | 602 } else { |
| 605 return NULL; | 603 return NULL; |
| 606 } | 604 } |
| 607 #else | 605 #else |
| 608 return NULL; | 606 return NULL; |
| 609 #endif | 607 #endif |
| 610 } | 608 } |
| 611 | 609 |
| 612 } // namespace policy | 610 } // namespace policy |
| OLD | NEW |