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

Unified Diff: chrome/browser/plugins/plugin_policy_handler.h

Issue 2410113002: Add migration code for the EnabledPlugins and DisabledPlugins policies. (Closed)
Patch Set: Invert the matching. Created 4 years, 2 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/plugins/plugin_policy_handler.h
diff --git a/chrome/browser/plugins/plugin_policy_handler.h b/chrome/browser/plugins/plugin_policy_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..4d6fcc0b89556987fee384e88f8e2a985bbc8dae
--- /dev/null
+++ b/chrome/browser/plugins/plugin_policy_handler.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PLUGINS_PLUGIN_POLICY_HANDLER_H_
+#define CHROME_BROWSER_PLUGINS_PLUGIN_POLICY_HANDLER_H_
+
+#include <map>
+#include <set>
+#include <vector>
+
+#include "base/macros.h"
+#include "chrome/browser/plugins/plugin_prefs.h"
+#include "components/content_settings/core/common/content_settings.h"
+#include "components/policy/core/browser/configuration_policy_handler.h"
+#include "components/policy/policy_constants.h"
+#include "components/prefs/pref_value_map.h"
+
+// Migrates values of deprecated plugin policies into their new counterpars.
+// It reads the set of EnabledPlugins and DisabledPlugins and updates the Flash
+// default behavior and PDF plugin behavior. All other values in the list are
+// ignored. The string matching rules are not trying to catch edge cases like
Bernhard Bauer 2016/10/14 11:49:46 This comments needs updating.
pastarmovj 2016/10/14 12:38:59 Yes. No need for the explanation anymore.
+// matching "Shockwave Flash Player" by "????????*Player". Only the direct
+// mentioning of "PDF" and "FLASH" or the wildcard "*" element are migrated to
+// the new policies.
+class PluginPolicyHandler : public policy::ConfigurationPolicyHandler {
+ public:
+ PluginPolicyHandler();
+ ~PluginPolicyHandler() override;
Bernhard Bauer 2016/10/14 11:49:46 If you have a protected section anyway, move the d
pastarmovj 2016/10/14 12:38:59 Nope. VC doesn't like it ninja -t msvc -e enviro
Bernhard Bauer 2016/10/14 15:27:05 Oh right. For posteriority, I think this is becaus
+
+ protected:
+ bool CheckPolicySettings(const policy::PolicyMap& policies,
+ policy::PolicyErrorMap* errors) override;
+ void ApplyPolicySettings(const policy::PolicyMap& policies,
+ PrefValueMap* prefs) override;
+
+ private:
+ void ProcessPolicy(const policy::PolicyMap& policies,
+ PrefValueMap* prefs,
+ const std::string& policy,
+ bool disable_pdf_plugin,
+ ContentSetting flash_content_setting);
+
+ DISALLOW_COPY_AND_ASSIGN(PluginPolicyHandler);
+};
+
+#endif // CHROME_BROWSER_PLUGINS_PLUGIN_POLICY_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698