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

Unified Diff: extensions/common/url_pattern_set.cc

Issue 377553003: Create a ManifestPermission implementation for Automation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Revert changes to automation_apitest.cc Created 6 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
« no previous file with comments | « extensions/common/url_pattern_set.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
+ return value.Pass();
+}
+
bool URLPatternSet::Populate(const base::ListValue& value,
int valid_schemes,
bool allow_file_access,
« no previous file with comments | « extensions/common/url_pattern_set.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698