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

Unified Diff: chrome/common/extensions/url_pattern.cc

Issue 8138004: Fix issues related to <all_urls> in extensions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: make the plugin.dll empty so it loads everywhere Created 9 years, 2 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/url_pattern.cc
diff --git a/chrome/common/extensions/url_pattern.cc b/chrome/common/extensions/url_pattern.cc
index 52489ae36582335c89aee8910152daf1aa17afa6..d854be49731263b71d08e9f4693e72d35d32303a 100644
--- a/chrome/common/extensions/url_pattern.cc
+++ b/chrome/common/extensions/url_pattern.cc
@@ -138,11 +138,7 @@ URLPattern::ParseResult URLPattern::Parse(const std::string& pattern,
// Special case pattern to match every valid URL.
if (pattern == kAllUrlsPattern) {
- match_all_urls_ = true;
- match_subdomains_ = true;
- scheme_ = "*";
- host_.clear();
- SetPath("/*");
+ SetMatchAllURLs(true);
return PARSE_SUCCESS;
}
@@ -257,6 +253,13 @@ void URLPattern::SetHost(const std::string& host) {
void URLPattern::SetMatchAllURLs(bool val) {
spec_.clear();
match_all_urls_ = val;
+
+ if (val) {
+ match_subdomains_ = true;
+ scheme_ = "*";
+ host_.clear();
+ SetPath("/*");
+ }
}
void URLPattern::SetMatchSubdomains(bool val) {
« no previous file with comments | « chrome/common/extensions/extension_permission_set_unittest.cc ('k') | chrome/common/extensions/url_pattern_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698