| Index: webkit/glue/plugins/plugin_list.cc
|
| diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc
|
| index bca7dbb40ffe88d5571a1055fb7a4a5143d510e4..12ae3ed5f02a49bc8d2c13459918f4fc5e5f78b0 100644
|
| --- a/webkit/glue/plugins/plugin_list.cc
|
| +++ b/webkit/glue/plugins/plugin_list.cc
|
| @@ -473,7 +473,6 @@ void PluginList::GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) {
|
| void PluginList::GetEnabledPlugins(bool refresh,
|
| std::vector<WebPluginInfo>* plugins) {
|
| LoadPlugins(refresh);
|
| -
|
| plugins->clear();
|
| AutoLock lock(lock_);
|
| for (std::vector<WebPluginInfo*>::const_iterator it = plugins_.begin();
|
| @@ -614,14 +613,15 @@ void PluginList::GetPluginGroups(
|
| plugin_groups->clear();
|
| for (PluginGroup::PluginMap::const_iterator it = plugin_groups_.begin();
|
| it != plugin_groups_.end(); ++it) {
|
| - plugin_groups->push_back(*it->second);
|
| + if (!it->second->IsEmpty())
|
| + plugin_groups->push_back(*it->second);
|
| }
|
| }
|
|
|
| const PluginGroup* PluginList::GetPluginGroup(
|
| const WebPluginInfo& web_plugin_info) {
|
| AutoLock lock(lock_);
|
| - return AddToPluginGroups(web_plugin_info, NULL);
|
| + return AddToPluginGroups(web_plugin_info, &plugins_);
|
| }
|
|
|
| string16 PluginList::GetPluginGroupName(std::string identifier) {
|
| @@ -635,7 +635,7 @@ string16 PluginList::GetPluginGroupName(std::string identifier) {
|
| std::string PluginList::GetPluginGroupIdentifier(
|
| const WebPluginInfo& web_plugin_info) {
|
| AutoLock lock(lock_);
|
| - PluginGroup* group = AddToPluginGroups(web_plugin_info, NULL);
|
| + PluginGroup* group = AddToPluginGroups(web_plugin_info, &plugins_);
|
| return group->identifier();
|
| }
|
|
|
| @@ -645,6 +645,7 @@ void PluginList::AddHardcodedPluginGroups() {
|
| for (size_t i = 0; i < GetPluginGroupDefinitionsSize(); ++i) {
|
| PluginGroup* definition_group = PluginGroup::FromPluginGroupDefinition(
|
| definitions[i]);
|
| + ProcessGroupAfterInitialize(definition_group);
|
| std::string identifier = definition_group->identifier();
|
| DCHECK(plugin_groups_.find(identifier) == plugin_groups_.end());
|
| plugin_groups_.insert(std::make_pair(identifier, definition_group));
|
| @@ -662,6 +663,7 @@ PluginGroup* PluginList::AddToPluginGroups(
|
| }
|
| if (!group) {
|
| group = PluginGroup::FromWebPluginInfo(web_plugin_info);
|
| + ProcessGroupAfterInitialize(group);
|
| std::string identifier = group->identifier();
|
| // If the identifier is not unique, use the full path. This means that we
|
| // probably won't be able to search for this group by identifier, but at
|
| @@ -674,21 +676,22 @@ PluginGroup* PluginList::AddToPluginGroups(
|
| DCHECK(plugin_groups_.find(identifier) == plugin_groups_.end());
|
| plugin_groups_.insert(std::make_pair(identifier, group));
|
| }
|
| - WebPluginInfo* group_plugin_copy;
|
| - bool is_new_addition = group->AddPlugin(
|
| - web_plugin_info, next_priority_, &group_plugin_copy);
|
| - if (plugins)
|
| - plugins->push_back(group_plugin_copy);
|
| - if (is_new_addition) {
|
| - next_priority_++;
|
| - string16 group_name = group->GetGroupName();
|
| - if (!group->Enabled() && !disabled_groups_.count(group_name)) {
|
| - disabled_groups_.insert(DisabledGroupsListElement(
|
| - group_name,
|
| - PluginGroup::IsPluginNameDisabledByPolicy(group_name) ?
|
| - POLICY : USER));
|
| - } else if (group->Enabled() && disabled_groups_.count(group_name)) {
|
| - disabled_groups_.erase(group_name);
|
| + if (plugins) {
|
| + WebPluginInfo* group_plugin_copy;
|
| + bool is_new_addition = group->AddPlugin(
|
| + web_plugin_info, next_priority_, &group_plugin_copy);
|
| + if (is_new_addition) {
|
| + plugins->push_back(group_plugin_copy);
|
| + next_priority_++;
|
| + string16 group_name = group->GetGroupName();
|
| + if (!group->Enabled() && !disabled_groups_.count(group_name)) {
|
| + disabled_groups_.insert(DisabledGroupsListElement(
|
| + group_name,
|
| + PluginGroup::IsPluginNameDisabledByPolicy(group_name) ?
|
| + POLICY : USER));
|
| + } else if (group->Enabled() && disabled_groups_.count(group_name)) {
|
| + disabled_groups_.erase(group_name);
|
| + }
|
| }
|
| // We don't need to protect the flag here because it is protected from the
|
| // callers of |AddToPluginGroups|.
|
|
|