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

Unified Diff: chrome/common/extensions/matcher/url_matcher.cc

Issue 10692158: Refactor URLBlacklistManager to use URLMatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 5 months 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
Index: chrome/common/extensions/matcher/url_matcher.cc
diff --git a/chrome/common/extensions/matcher/url_matcher.cc b/chrome/common/extensions/matcher/url_matcher.cc
index d13b508c7d9323037a3b43aaa39ffbc291fb5afb..1683905cd6017a2978f134f209cdf7e0e3ec576e 100644
--- a/chrome/common/extensions/matcher/url_matcher.cc
+++ b/chrome/common/extensions/matcher/url_matcher.cc
@@ -259,7 +259,7 @@ URLMatcherCondition URLMatcherConditionFactory::CreatePathPrefixCondition(
URLMatcherCondition URLMatcherConditionFactory::CreatePathSuffixCondition(
const std::string& suffix) {
- return CreateCondition(URLMatcherCondition::HOST_SUFFIX, suffix + kEndOfPath);
+ return CreateCondition(URLMatcherCondition::PATH_SUFFIX, suffix + kEndOfPath);
}
URLMatcherCondition URLMatcherConditionFactory::CreatePathContainsCondition(
@@ -303,6 +303,15 @@ URLMatcherCondition
host_suffix + kEndOfDomain + path_prefix);
}
+URLMatcherCondition
+URLMatcherConditionFactory::CreateHostEqualsPathPrefixCondition(
+ const std::string& host,
+ const std::string& path_prefix) {
+ return CreateCondition(URLMatcherCondition::HOST_EQUALS_PATH_PREFIX,
+ kBeginningOfURL + CanonicalizeHostname(host) + kEndOfDomain +
+ path_prefix);
+}
+
std::string URLMatcherConditionFactory::CanonicalizeURLForFullSearches(
const GURL& url) {
return kBeginningOfURL + CanonicalizeHostname(url.host()) + url.path() +
@@ -327,7 +336,7 @@ URLMatcherCondition URLMatcherConditionFactory::CreateURLContainsCondition(
URLMatcherCondition URLMatcherConditionFactory::CreateURLEqualsCondition(
const std::string& str) {
- return CreateCondition(URLMatcherCondition::QUERY_EQUALS,
+ return CreateCondition(URLMatcherCondition::URL_EQUALS,
kBeginningOfURL + CanonicalizeHostname(str) + kEndOfURL);
}

Powered by Google App Engine
This is Rietveld 408576698