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

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

Issue 2474713003: Migrate enabled state of plugins into specialized Flash and PDF prefs. (Closed)
Patch Set: Address comments. Created 4 years, 1 month 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/plugins/plugin_metadata.cc ('k') | chrome/browser/plugins/plugin_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_policy_handler.cc
diff --git a/chrome/browser/plugins/plugin_policy_handler.cc b/chrome/browser/plugins/plugin_policy_handler.cc
index 06556d1ad3cb3d68059d328be0d402c42f6412d1..7d03b3b77a390517343fb97649e15364e4e4179c 100644
--- a/chrome/browser/plugins/plugin_policy_handler.cc
+++ b/chrome/browser/plugins/plugin_policy_handler.cc
@@ -10,6 +10,7 @@
#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
#include "base/values.h"
+#include "chrome/browser/plugins/plugin_metadata.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/pref_names.h"
@@ -20,8 +21,6 @@
namespace {
-const char kAdobeFlashPlayerName[] = "Adobe Flash Player";
-
// Retrieves a list typed policy or nullptr if not present or not a list.
const base::ListValue* GetListPolicy(const policy::PolicyMap& policies,
const std::string& policy) {
@@ -60,7 +59,8 @@ void PluginPolicyHandler::ProcessPolicy(const policy::PolicyMap& policies,
prefs::kPluginsAlwaysOpenPdfExternally,
base::MakeUnique<base::FundamentalValue>(disable_pdf_plugin));
}
- if ((base::MatchPattern(kAdobeFlashPlayerName, plugin) ||
+ if ((base::MatchPattern(
+ PluginMetadata::kAdobeFlashPlayerGroupName, plugin) ||
base::MatchPattern(content::kFlashPluginName, plugin)) &&
!policies.GetValue(policy::key::kDefaultPluginsSetting)) {
prefs->SetValue(
@@ -110,7 +110,8 @@ void PluginPolicyHandler::ApplyPolicySettings(const policy::PolicyMap& policies,
!policies.GetValue(policy::key::kAlwaysOpenPdfExternally)) {
prefs->RemoveValue(prefs::kPluginsAlwaysOpenPdfExternally);
}
- if ((base::MatchPattern(kAdobeFlashPlayerName, plugin) ||
+ if ((base::MatchPattern(
+ PluginMetadata::kAdobeFlashPlayerGroupName, plugin) ||
base::MatchPattern(content::kFlashPluginName, plugin)) &&
!policies.GetValue(policy::key::kDefaultPluginsSetting)) {
prefs->RemoveValue(prefs::kManagedDefaultPluginsSetting);
« no previous file with comments | « chrome/browser/plugins/plugin_metadata.cc ('k') | chrome/browser/plugins/plugin_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698