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..4801b12114c4c6081fe34391f692127cf770632d 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.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::AllowedTypesMapType* it = |
+ extensions::schema_constants::kAllowedTypesMap; |
+ it->name; |
+ ++it) { |
+ result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
+ it->name, |
+ scoped_ptr<base::Value>( |
+ new base::FundamentalValue(it->manifest_type)))); |
+ } |
} |
#endif |