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

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

Issue 344693004: Add a policy to re-enable deprecated web platform features. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to ToT Created 6 years, 6 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
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0741e6e9590076c778dd423ffb1a3675260b7ec6..2a47ba1adf2831f887e7653d275ef1c88e4044c7 100644
--- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc
+++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/policy/managed_bookmarks_policy_handler.h"
#include "chrome/browser/profiles/incognito_mode_policy_handler.h"
#include "chrome/browser/search_engines/default_search_policy_handler.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/policy/core/browser/autofill_policy_handler.h"
@@ -491,25 +492,35 @@ 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(
+ "extension", scoped_ptr<base::Value>(new base::FundamentalValue(
extensions::Manifest::TYPE_EXTENSION))));
result->push_back(new StringMappingListPolicyHandler::MappingEntry(
- "theme", scoped_ptr<base::Value>(base::Value::CreateIntegerValue(
+ "theme", scoped_ptr<base::Value>(new base::FundamentalValue(
extensions::Manifest::TYPE_THEME))));
result->push_back(new StringMappingListPolicyHandler::MappingEntry(
- "user_script", scoped_ptr<base::Value>(base::Value::CreateIntegerValue(
+ "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>(base::Value::CreateIntegerValue(
+ "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>(
- base::Value::CreateIntegerValue(
- extensions::Manifest::TYPE_LEGACY_PACKAGED_APP))));
+ "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>(base::Value::CreateIntegerValue(
+ "platform_app", scoped_ptr<base::Value>(new base::FundamentalValue(
extensions::Manifest::TYPE_PLATFORM_APP))));
}
+
+void GetDeprecatedFeaturesMap(
+ ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) {
+ // Maps feature tags as specified in policy to the corresponding switch to
+ // re-enable them.
+ // TODO: Remove after 2015-04-30 per http://crbug.com/374782.
+ result->push_back(new StringMappingListPolicyHandler::MappingEntry(
+ "ShowModalDialog_EffectiveUntil20150430",
+ scoped_ptr<base::Value>(new base::StringValue(
+ switches::kEnableShowModalDialog))));
+}
#endif // !defined(OS_IOS)
} // namespace
@@ -581,6 +592,11 @@ scoped_ptr<ConfigurationPolicyHandlerList> BuildHandlerList(
key::kExtensionAllowedTypes,
extensions::pref_names::kAllowedTypes,
base::Bind(GetExtensionAllowedTypesMap))));
+ handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>(
+ new StringMappingListPolicyHandler(
+ key::kEnableDeprecatedWebPlatformFeatures,
+ prefs::kEnableDeprecatedWebPlatformFeatures,
+ base::Bind(GetDeprecatedFeaturesMap))));
#endif // !defined(OS_IOS)
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS)
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698