Chromium Code Reviews| 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 |
| +// matching "Shockwave Flash Player" by "????????*Player". Only the direct |
| +// mentioning of "PDF" and "FLASH" or the wildcard "*" element are migrated to |
| +// the new policies. |
|
Bernhard Bauer
2016/10/12 15:28:49
Hm... wouldn't it actually be _easier_ to just mat
pastarmovj
2016/10/13 13:29:00
We have been advising admins on various bugs to be
Bernhard Bauer
2016/10/13 14:33:08
I don't doubt there are wildcard policies out in t
|
| +class PluginPolicyHandler : public policy::ConfigurationPolicyHandler { |
| + public: |
| + PluginPolicyHandler(); |
| + ~PluginPolicyHandler() override; |
| + |
| + 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_ |