Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2310)

Unified Diff: chrome/browser/plugins/plugin_metadata.cc

Issue 11418129: Matching IBM Java plugin using pattern matching. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugins/plugin_metadata.h ('k') | chrome/browser/resources/plugin_metadata/plugins_win.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/browser/plugins/plugin_metadata.h ('k') | chrome/browser/resources/plugin_metadata/plugins_win.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698