summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/url_pattern.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 10:01:05 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 10:01:05 +0000
commit9f72aa09129fbd19a5ae253371019752a0624997 (patch)
tree6c54d2280ebdf31fe31f46fd3d882977324e4f3d /chrome/common/extensions/url_pattern.h
parent0a73a37731cf87370cb7c4f8dcb4801277c1d858 (diff)
downloadchromium_src-9f72aa09129fbd19a5ae253371019752a0624997.zip
chromium_src-9f72aa09129fbd19a5ae253371019752a0624997.tar.gz
chromium_src-9f72aa09129fbd19a5ae253371019752a0624997.tar.bz2
Reland r50834
TBR=tony@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/url_pattern.h')
-rw-r--r--chrome/common/extensions/url_pattern.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/common/extensions/url_pattern.h b/chrome/common/extensions/url_pattern.h
index dba393a..e25faaf 100644
--- a/chrome/common/extensions/url_pattern.h
+++ b/chrome/common/extensions/url_pattern.h
@@ -73,6 +73,9 @@ class URLPattern {
// otherwise.
static bool IsValidScheme(const std::string& scheme);
+ // Convenience to create a pattern from a string.
+ static URLPattern* CreateFromString(const std::string& pattern);
+
URLPattern() : match_subdomains_(false) {}
// Initializes this instance by parsing the provided string. On failure, the
@@ -82,6 +85,13 @@ class URLPattern {
// Returns true if this instance matches the specified URL.
bool MatchesUrl(const GURL& url) const;
+ // Returns true if |test| matches our host.
+ bool MatchesHost(const std::string& host) const;
+ bool MatchesHost(const GURL& test) const;
+
+ // Returns true if |test| matches our path.
+ bool MatchesPath(const GURL& test) const;
+
std::string GetAsString() const;
// Get the scheme the pattern matches. This will always return a valid scheme
@@ -107,12 +117,6 @@ class URLPattern {
}
private:
- // Returns true if |test| matches our host.
- bool MatchesHost(const GURL& test) const;
-
- // Returns true if |test| matches our path.
- bool MatchesPath(const GURL& test) const;
-
// The scheme for the pattern.
std::string scheme_;