Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5057)

Unified Diff: chrome/browser/policy/configuration_policy_handler_list_factory.cc

Issue 559603002: Add new ExtensionManagement preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bcae9a748a41456548f5538959fac8fb7e908631 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,16 @@ 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 (size_t index = 0;
+ index < extensions::schema_constants::kAllowedTypesMapSize;
+ index++) {
Joao da Silva 2014/09/19 07:27:26 ++index
+ const extensions::schema_constants::AllowedTypesMapEntry& entry =
+ extensions::schema_constants::kAllowedTypesMap[index];
+ result->push_back(new StringMappingListPolicyHandler::MappingEntry(
+ entry.name,
+ scoped_ptr<base::Value>(
+ new base::FundamentalValue(entry.manifest_type))));
+ }
}
#endif

Powered by Google App Engine
This is Rietveld 408576698