| Index: chrome/browser/plugin_updater.cc
|
| diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc
|
| index 40f3be1ec48c20c2e04b21a989f870a84cafeda7..606b5ba427fefaa2e338c7155b374356a356561b 100644
|
| --- a/chrome/browser/plugin_updater.cc
|
| +++ b/chrome/browser/plugin_updater.cc
|
| @@ -63,13 +63,14 @@ void PluginUpdater::EnablePluginGroup(bool enable, const string16& group_name) {
|
| NotifyPluginStatusChanged();
|
| }
|
|
|
| -void PluginUpdater::EnablePluginFile(bool enable,
|
| - const FilePath::StringType& path) {
|
| +void PluginUpdater::EnablePlugin(bool enable,
|
| + const FilePath::StringType& path,
|
| + const string16& name) {
|
| FilePath file_path(path);
|
| - if (enable && !PluginGroup::IsPluginPathDisabledByPolicy(file_path))
|
| - NPAPI::PluginList::Singleton()->EnablePlugin(file_path);
|
| + if (enable)
|
| + NPAPI::PluginList::Singleton()->EnablePlugin(file_path, name);
|
| else
|
| - NPAPI::PluginList::Singleton()->DisablePlugin(file_path);
|
| + NPAPI::PluginList::Singleton()->DisablePlugin(file_path, name);
|
|
|
| NotifyPluginStatusChanged();
|
| }
|
| @@ -189,8 +190,11 @@ void PluginUpdater::DisablePluginGroupsFromPrefs(Profile* profile) {
|
| }
|
| }
|
| }
|
| - if (!enabled)
|
| - NPAPI::PluginList::Singleton()->DisablePlugin(plugin_path);
|
| + if (!enabled) {
|
| + string16 name;
|
| + plugin->GetString("name", &name);
|
| + NPAPI::PluginList::Singleton()->DisablePlugin(plugin_path, name);
|
| + }
|
| } else if (!enabled && plugin->GetString("name", &group_name)) {
|
| // Don't disable this group if it's for the pdf plugin and we just
|
| // forced it on.
|
| @@ -213,7 +217,7 @@ void PluginUpdater::DisablePluginGroupsFromPrefs(Profile* profile) {
|
| !force_internal_pdf_for_this_run) {
|
| // The internal PDF plugin is disabled by default, and the user hasn't
|
| // overridden the default.
|
| - NPAPI::PluginList::Singleton()->DisablePlugin(pdf_path);
|
| + NPAPI::PluginList::Singleton()->DisablePlugin(pdf_path, pdf_group_name);
|
| EnablePluginGroup(false, pdf_group_name);
|
| }
|
|
|
| @@ -246,9 +250,9 @@ void PluginUpdater::GetPreferencesDataOnFileThread(void* profile) {
|
| BrowserThread::PostTask(
|
| BrowserThread::UI,
|
| FROM_HERE,
|
| - NewRunnableFunction(
|
| - &PluginUpdater::OnUpdatePreferences,
|
| - static_cast<Profile*>(profile), plugins, groups));
|
| + NewRunnableFunction(&PluginUpdater::OnUpdatePreferences,
|
| + static_cast<Profile*>(profile),
|
| + plugins, groups));
|
| }
|
|
|
| void PluginUpdater::OnUpdatePreferences(
|
| @@ -265,15 +269,24 @@ void PluginUpdater::OnUpdatePreferences(
|
| internal_dir);
|
|
|
| // Add the plugin files.
|
| - for (std::vector<WebPluginInfo>::const_iterator it = plugins.begin();
|
| - it != plugins.end();
|
| - ++it) {
|
| - plugins_list->Append(CreatePluginFileSummary(*it));
|
| + for (size_t i = 0; i < plugins.size(); ++i) {
|
| + DictionaryValue* summary = CreatePluginFileSummary(plugins[i]);
|
| + // If the plugin is disabled only by policy don't store this state in the
|
| + // user pref store.
|
| + if (!plugins[i].IsEnabled() && plugins[i].reason == WebPluginInfo::MANAGED)
|
| + summary->SetBoolean("enabled", true);
|
| + plugins_list->Append(summary);
|
| }
|
|
|
| // Add the groups as well.
|
| for (size_t i = 0; i < groups.size(); ++i) {
|
| - plugins_list->Append(groups[i].GetSummary());
|
| + DictionaryValue* summary = groups[i].GetSummary();
|
| + // If the plugin is disabled only by policy don't store this state in the
|
| + // user pref store.
|
| + if (!groups[i].Enabled() &&
|
| + PluginGroup::IsPluginNameDisabledByPolicy(groups[i].GetGroupName()))
|
| + summary->SetBoolean("enabled", true);
|
| + plugins_list->Append(summary);
|
| }
|
| }
|
|
|
|
|