Index: webkit/glue/plugins/plugin_group.cc |
diff --git a/webkit/glue/plugins/plugin_group.cc b/webkit/glue/plugins/plugin_group.cc |
index 548e624a81fd239a9406a24dd134e5cf0503f374..22a5d973fca6e4cd52f6cc853ec64ab8ed5d30ca 100644 |
--- a/webkit/glue/plugins/plugin_group.cc |
+++ b/webkit/glue/plugins/plugin_group.cc |
@@ -109,13 +109,10 @@ void PluginGroup::InitFrom(const PluginGroup& other) { |
description_ = other.description_; |
update_url_ = other.update_url_; |
enabled_ = other.enabled_; |
- for (size_t i = 0; i < other.version_ranges_.size(); ++i) |
- version_ranges_.push_back(other.version_ranges_[i]); |
- DCHECK_EQ(other.web_plugin_infos_.size(), other.web_plugin_positions_.size()); |
- for (size_t i = 0; i < other.web_plugin_infos_.size(); ++i) |
- AddPlugin(other.web_plugin_infos_[i], other.web_plugin_positions_[i]); |
- if (!version_.get()) |
- version_.reset(Version::GetVersionFromString("0")); |
+ version_ranges_ = other.version_ranges_; |
+ version_.reset(other.version_->Clone()); |
+ web_plugin_infos_ = other.web_plugin_infos_; |
+ web_plugin_positions_ = other.web_plugin_positions_; |
} |
PluginGroup::PluginGroup(const PluginGroup& other) { |
@@ -123,7 +120,6 @@ PluginGroup::PluginGroup(const PluginGroup& other) { |
} |
PluginGroup& PluginGroup::operator=(const PluginGroup& other) { |
- version_ranges_.clear(); |
InitFrom(other); |
return *this; |
} |
@@ -252,6 +248,10 @@ void PluginGroup::AddPlugin(const WebPluginInfo& plugin, int position) { |
UpdateActivePlugin(plugin); |
} |
+bool PluginGroup::IsEmpty() const { |
+ return web_plugin_infos_.empty(); |
+} |
+ |
string16 PluginGroup::GetGroupName() const { |
if (!group_name_.empty()) |
return group_name_; |