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 99340ef7af4ad8c06acdd71e532448015c110573..04969ddc79f0b5ab8e652e19286d2fc3eb134c26 100644 |
| --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc |
| +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc |
| @@ -50,6 +50,7 @@ |
| #if defined(ENABLE_EXTENSIONS) |
| #include "chrome/browser/extensions/api/messaging/native_messaging_policy_handler.h" |
| +#include "chrome/browser/extensions/extension_management_constants.h" |
| #include "chrome/browser/extensions/policy_handlers.h" |
| #include "extensions/browser/pref_names.h" |
| #include "extensions/common/manifest.h" |
| @@ -493,24 +494,15 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { |
| 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>(new base::FundamentalValue( |
| - extensions::Manifest::TYPE_EXTENSION)))); |
| - result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| - "theme", scoped_ptr<base::Value>(new base::FundamentalValue( |
| - extensions::Manifest::TYPE_THEME)))); |
| - result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| - "user_script", scoped_ptr<base::Value>(new base::FundamentalValue( |
| - extensions::Manifest::TYPE_USER_SCRIPT)))); |
| - result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| - "hosted_app", scoped_ptr<base::Value>(new base::FundamentalValue( |
| - extensions::Manifest::TYPE_HOSTED_APP)))); |
| - result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| - "legacy_packaged_app", scoped_ptr<base::Value>(new base::FundamentalValue( |
| - extensions::Manifest::TYPE_LEGACY_PACKAGED_APP)))); |
| - result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| - "platform_app", scoped_ptr<base::Value>(new base::FundamentalValue( |
| - extensions::Manifest::TYPE_PLATFORM_APP)))); |
| + for (const extensions::schema_constants::AllowedTypesMapEntry* it = |
| + extensions::schema_constants::kAllowedTypesMap; |
| + it->name; |
| + ++it) { |
|
Joao da Silva
2014/09/18 15:23:54
Needs to be updated to use an int iterator and kAl
binjin
2014/09/18 15:49:04
Done.
|
| + result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
| + it->name, |
| + scoped_ptr<base::Value>( |
| + new base::FundamentalValue(it->manifest_type)))); |
| + } |
| } |
| #endif |