Chromium Code Reviews| Index: extensions/common/url_pattern_set.cc |
| diff --git a/extensions/common/url_pattern_set.cc b/extensions/common/url_pattern_set.cc |
| index b167d0fe75fae8da1f8f249d504b07a9331dc8e5..ee5ea933830f3cc46e9267c1044942f0487901f2 100644 |
| --- a/extensions/common/url_pattern_set.cc |
| +++ b/extensions/common/url_pattern_set.cc |
| @@ -171,6 +171,15 @@ bool URLPatternSet::MatchesURL(const GURL& url) const { |
| return false; |
| } |
| +bool URLPatternSet::MatchesAllURLs() const { |
| + for (URLPatternSet::const_iterator host = begin(); host != end(); ++host) { |
| + if (host->match_all_urls() || |
| + (host->match_subdomains() && host->host().empty())) |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| bool URLPatternSet::MatchesSecurityOrigin(const GURL& origin) const { |
| for (URLPatternSet::const_iterator pattern = patterns_.begin(); |
| pattern != patterns_.end(); ++pattern) { |
| @@ -229,6 +238,17 @@ bool URLPatternSet::Populate(const std::vector<std::string>& patterns, |
| return true; |
| } |
| +scoped_ptr<std::vector<std::string> > URLPatternSet::ToStringVector() const { |
| + scoped_ptr<std::vector<std::string> > value(new std::vector<std::string>); |
| + for (URLPatternSet::const_iterator i = patterns_.begin(); |
| + i != patterns_.end(); |
| + ++i) { |
| + value->push_back(i->GetAsString()); |
| + } |
| + std::unique(value->begin(), value->end()); |
|
Devlin
2014/07/18 22:38:51
I don't think we need this, since |patterns_| is a
aboxhall
2014/07/21 22:44:10
Makes sense, done.
|
| + return value.Pass(); |
| +} |
| + |
| bool URLPatternSet::Populate(const base::ListValue& value, |
| int valid_schemes, |
| bool allow_file_access, |