| Index: chrome/browser/plugin_prefs.cc
|
| diff --git a/chrome/browser/plugin_prefs.cc b/chrome/browser/plugin_prefs.cc
|
| index 00472170397c438f6079862e772131a61e6e38e0..56b2c22707ed02ef1b7419b6211600674d1f5451 100644
|
| --- a/chrome/browser/plugin_prefs.cc
|
| +++ b/chrome/browser/plugin_prefs.cc
|
| @@ -18,6 +18,7 @@
|
| #include "base/values.h"
|
| #include "base/version.h"
|
| #include "chrome/browser/browser_process.h"
|
| +#include "chrome/browser/plugin_installer.h"
|
| #include "chrome/browser/plugin_prefs_factory.h"
|
| #include "chrome/browser/prefs/scoped_user_pref_update.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| @@ -133,25 +134,33 @@ void PluginPrefs::EnablePluginGroupInternal(
|
| base::Bind(&PluginPrefs::NotifyPluginStatusChanged, this));
|
| }
|
|
|
| -bool PluginPrefs::CanEnablePlugin(bool enabled, const FilePath& path) {
|
| - webkit::npapi::PluginList* plugin_list = GetPluginList();
|
| +void PluginPrefs::CanEnablePlugin(bool enabled, const FilePath& path,
|
| + const base::Callback<void(bool)>& cb) {
|
| + PluginFinder::Get(base::Bind(&PluginPrefs::CanEnablePluginCallback,
|
| + this, enabled, path, cb));
|
| +}
|
| +
|
| +void PluginPrefs::CanEnablePluginCallback(bool enabled, const FilePath& path,
|
| + const base::Callback<void(bool)>& cb,
|
| + PluginFinder* finder) {
|
| webkit::WebPluginInfo plugin;
|
| + bool can_enable = true;
|
| if (PluginService::GetInstance()->GetPluginInfoByPath(path, &plugin)) {
|
| - scoped_ptr<webkit::npapi::PluginGroup> group(
|
| - plugin_list->GetPluginGroup(plugin));
|
| + PluginInstaller* installer = finder->GetPluginInstaller(plugin);
|
| PolicyStatus plugin_status = PolicyStatusForPlugin(plugin.name);
|
| - PolicyStatus group_status = PolicyStatusForPlugin(group->GetGroupName());
|
| + PolicyStatus group_status = PolicyStatusForPlugin(installer->name());
|
| if (enabled) {
|
| if (plugin_status == POLICY_DISABLED || group_status == POLICY_DISABLED)
|
| - return false;
|
| + can_enable = false;
|
| } else {
|
| if (plugin_status == POLICY_ENABLED || group_status == POLICY_ENABLED)
|
| - return false;
|
| + can_enable = false;
|
| }
|
| } else {
|
| NOTREACHED();
|
| }
|
| - return true;
|
| +
|
| + cb.Run(can_enable);
|
| }
|
|
|
| void PluginPrefs::EnablePlugin(bool enabled, const FilePath& path,
|
|
|