diff options
Diffstat (limited to 'chrome/common/extensions/url_pattern.h')
-rw-r--r-- | chrome/common/extensions/url_pattern.h | 16 |
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_; |