Chromium Code Reviews| 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("/*"); |
| + } |
| } |
|
jstritar
2011/10/10 20:23:24
This was the real bug- the <all_urls> URLPatterns
Matt Perry
2011/10/10 23:22:39
Hmm.. I think the real bug is that the caller didn
jstritar
2011/10/11 15:13:38
Ah, I see... you're supposed to always call Parse.
|
| void URLPattern::SetMatchSubdomains(bool val) { |