Chromium Code Reviews| Index: chrome/browser/plugins/plugin_metadata.cc |
| =================================================================== |
| --- chrome/browser/plugins/plugin_metadata.cc (revision 169236) |
| +++ chrome/browser/plugins/plugin_metadata.cc (working copy) |
| @@ -7,6 +7,7 @@ |
| #include <algorithm> |
| #include "base/logging.h" |
| +#include "base/string_util.h" |
| #include "webkit/plugins/npapi/plugin_list.h" |
| #include "webkit/plugins/npapi/plugin_utils.h" |
| #include "webkit/plugins/webplugininfo.h" |
| @@ -27,14 +28,16 @@ |
| const GURL& plugin_url, |
| const GURL& help_url, |
| const string16& group_name_matcher, |
| - const std::string& language) |
| + const std::string& language, |
| + bool use_pattern_matching) |
| : identifier_(identifier), |
| name_(name), |
| group_name_matcher_(group_name_matcher), |
| url_for_display_(url_for_display), |
| plugin_url_(plugin_url), |
| help_url_(help_url), |
| - language_(language) { |
| + language_(language), |
| + use_pattern_matching_(use_pattern_matching) { |
| } |
| PluginMetadata::~PluginMetadata() { |
| @@ -69,7 +72,9 @@ |
| return false; |
| } |
| - return plugin.name.find(group_name_matcher_) != string16::npos; |
| + return use_pattern_matching_ ? |
|
Bernhard Bauer
2012/11/22 18:40:48
Hm, we might be able to keep this a bit simpler by
|
| + MatchPattern(plugin.name, group_name_matcher_) : |
| + plugin.name.find(group_name_matcher_) != string16::npos; |
| } |
| // static |
| @@ -128,7 +133,8 @@ |
| plugin_url_, |
| help_url_, |
| group_name_matcher_, |
| - language_); |
| + language_, |
| + use_pattern_matching_); |
| copy->versions_ = versions_; |
| return make_scoped_ptr(copy); |
| } |