| 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/configuration_policy_handler_list.h" | 5 #include "chrome/browser/policy/configuration_policy_handler_list.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_value_map.h" | 7 #include "base/prefs/pref_value_map.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/policy/configuration_policy_handler.h" | 10 #include "chrome/browser/policy/configuration_policy_handler.h" |
| 11 #include "chrome/browser/policy/policy_error_map.h" | 11 #include "chrome/browser/policy/policy_error_map.h" |
| 12 #include "chrome/browser/policy/policy_map.h" | 12 #include "chrome/browser/policy/policy_map.h" |
| 13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/manifest.h" |
| 14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 15 #include "chromeos/network/onc/onc_constants.h" | 15 #include "chromeos/network/onc/onc_constants.h" |
| 16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 17 #include "policy/policy_constants.h" | 17 #include "policy/policy_constants.h" |
| 18 | 18 |
| 19 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
| 20 #include "chrome/browser/policy/configuration_policy_handler_chromeos.h" | 20 #include "chrome/browser/policy/configuration_policy_handler_chromeos.h" |
| 21 #endif // defined(OS_CHROMEOS) | 21 #endif // defined(OS_CHROMEOS) |
| 22 | 22 |
| 23 namespace policy { | 23 namespace policy { |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 Value::TYPE_INTEGER }, | 348 Value::TYPE_INTEGER }, |
| 349 #endif // defined(OS_CHROMEOS) | 349 #endif // defined(OS_CHROMEOS) |
| 350 | 350 |
| 351 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) | 351 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) |
| 352 { key::kBackgroundModeEnabled, | 352 { key::kBackgroundModeEnabled, |
| 353 prefs::kBackgroundModeEnabled, | 353 prefs::kBackgroundModeEnabled, |
| 354 Value::TYPE_BOOLEAN }, | 354 Value::TYPE_BOOLEAN }, |
| 355 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) | 355 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 // Mapping from extension type names to Extension::Type. | 358 // Mapping from extension type names to Manifest::Type. |
| 359 StringToIntEnumListPolicyHandler::MappingEntry kExtensionAllowedTypesMap[] = { | 359 StringToIntEnumListPolicyHandler::MappingEntry kExtensionAllowedTypesMap[] = { |
| 360 { "extension", extensions::Extension::TYPE_EXTENSION }, | 360 { "extension", extensions::Manifest::TYPE_EXTENSION }, |
| 361 { "theme", extensions::Extension::TYPE_THEME }, | 361 { "theme", extensions::Manifest::TYPE_THEME }, |
| 362 { "user_script", extensions::Extension::TYPE_USER_SCRIPT }, | 362 { "user_script", extensions::Manifest::TYPE_USER_SCRIPT }, |
| 363 { "hosted_app", extensions::Extension::TYPE_HOSTED_APP }, | 363 { "hosted_app", extensions::Manifest::TYPE_HOSTED_APP }, |
| 364 { "legacy_packaged_app", extensions::Extension::TYPE_LEGACY_PACKAGED_APP }, | 364 { "legacy_packaged_app", extensions::Manifest::TYPE_LEGACY_PACKAGED_APP }, |
| 365 { "platform_app", extensions::Extension::TYPE_PLATFORM_APP }, | 365 { "platform_app", extensions::Manifest::TYPE_PLATFORM_APP }, |
| 366 }; | 366 }; |
| 367 | 367 |
| 368 } // namespace | 368 } // namespace |
| 369 | 369 |
| 370 ConfigurationPolicyHandlerList::ConfigurationPolicyHandlerList() { | 370 ConfigurationPolicyHandlerList::ConfigurationPolicyHandlerList() { |
| 371 for (size_t i = 0; i < arraysize(kSimplePolicyMap); ++i) { | 371 for (size_t i = 0; i < arraysize(kSimplePolicyMap); ++i) { |
| 372 handlers_.push_back( | 372 handlers_.push_back( |
| 373 new SimplePolicyHandler(kSimplePolicyMap[i].policy_name, | 373 new SimplePolicyHandler(kSimplePolicyMap[i].policy_name, |
| 374 kSimplePolicyMap[i].preference_path, | 374 kSimplePolicyMap[i].preference_path, |
| 375 kSimplePolicyMap[i].value_type)); | 375 kSimplePolicyMap[i].value_type)); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 } | 449 } |
| 450 | 450 |
| 451 void ConfigurationPolicyHandlerList::PrepareForDisplaying( | 451 void ConfigurationPolicyHandlerList::PrepareForDisplaying( |
| 452 PolicyMap* policies) const { | 452 PolicyMap* policies) const { |
| 453 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; | 453 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; |
| 454 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) | 454 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) |
| 455 (*handler)->PrepareForDisplaying(policies); | 455 (*handler)->PrepareForDisplaying(policies); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace policy | 458 } // namespace policy |
| OLD | NEW |