Chromium Code Reviews| Index: chrome/browser/policy/configuration_policy_handler_list_factory.cc |
| diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc |
| index 4795d6e5d5e5f37c4162af9827047aa7dd740e01..6971e4a738114e732b1279348d406df3a2472e66 100644 |
| --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc |
| +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc |
| @@ -484,15 +484,29 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { |
| }; |
| #if !defined(OS_IOS) |
| -// Mapping from extension type names to Manifest::Type. |
| -StringToIntEnumListPolicyHandler::MappingEntry kExtensionAllowedTypesMap[] = { |
| - { "extension", extensions::Manifest::TYPE_EXTENSION }, |
| - { "theme", extensions::Manifest::TYPE_THEME }, |
| - { "user_script", extensions::Manifest::TYPE_USER_SCRIPT }, |
| - { "hosted_app", extensions::Manifest::TYPE_HOSTED_APP }, |
| - { "legacy_packaged_app", extensions::Manifest::TYPE_LEGACY_PACKAGED_APP }, |
| - { "platform_app", extensions::Manifest::TYPE_PLATFORM_APP }, |
| -}; |
| +void GetExtensionAllowedTypesMap( |
| + ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) { |
| + // Mapping from extension type names to Manifest::Type. |
| + result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| + "extension", scoped_ptr<base::Value>(base::Value::CreateIntegerValue( |
| + extensions::Manifest::TYPE_EXTENSION)))); |
| + result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| + "theme", scoped_ptr<base::Value>(base::Value::CreateIntegerValue( |
| + extensions::Manifest::TYPE_THEME)))); |
| + result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| + "user_script", scoped_ptr<base::Value>(base::Value::CreateIntegerValue( |
| + extensions::Manifest::TYPE_USER_SCRIPT)))); |
| + result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| + "hosted_app", scoped_ptr<base::Value>(base::Value::CreateIntegerValue( |
| + extensions::Manifest::TYPE_HOSTED_APP)))); |
| + result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| + "legacy_packaged_app", scoped_ptr<base::Value>( |
| + base::Value::CreateIntegerValue( |
| + extensions::Manifest::TYPE_LEGACY_PACKAGED_APP)))); |
| + result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| + "platform_app", scoped_ptr<base::Value>(base::Value::CreateIntegerValue( |
|
Joao da Silva
2014/06/18 08:45:26
CreateIntegerValue is deprecated, use new base::Fu
|
| + extensions::Manifest::TYPE_PLATFORM_APP)))); |
| +} |
| #endif // !defined(OS_IOS) |
| } // namespace |
| @@ -560,11 +574,10 @@ scoped_ptr<ConfigurationPolicyHandlerList> BuildHandlerList( |
| key::kExtensionInstallSources, |
| extensions::pref_names::kAllowedInstallSites))); |
| handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( |
| - new StringToIntEnumListPolicyHandler( |
| + new StringMappingListPolicyHandler( |
| key::kExtensionAllowedTypes, |
| extensions::pref_names::kAllowedTypes, |
| - kExtensionAllowedTypesMap, |
| - kExtensionAllowedTypesMap + arraysize(kExtensionAllowedTypesMap)))); |
| + base::Bind(GetExtensionAllowedTypesMap)))); |
| #endif // !defined(OS_IOS) |
| #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) |