Chromium Code Reviews| Index: chrome/common/content_settings_pattern_parser.cc |
| =================================================================== |
| --- chrome/common/content_settings_pattern_parser.cc (revision 116653) |
| +++ chrome/common/content_settings_pattern_parser.cc (working copy) |
| @@ -42,6 +42,8 @@ |
| const char* PatternParser::kPortWildcard = "*"; |
| +const char* PatternParser::kPathWildcard = "/*"; |
|
markusheintz_
2012/01/09 15:01:00
I would prefer that the path wildcard is '*' only,
Francois
2012/01/09 15:33:01
Done.
|
| + |
| // static |
| void PatternParser::Parse(const std::string& pattern_spec, |
| ContentSettingsPattern::BuilderInterface* builder) { |
| @@ -169,13 +171,18 @@ |
| builder->WithPort(port); |
| } |
| } else { |
| - if (scheme != std::string(chrome::kExtensionScheme)) |
| + if (scheme != std::string(chrome::kExtensionScheme) && |
| + scheme != std::string(chrome::kFileScheme)) |
| builder->WithPortWildcard(); |
| } |
| if (path_component.IsNonEmpty()) { |
| - builder->WithPath(pattern_spec.substr(path_component.start, |
| - path_component.len)); |
| + const std::string path = pattern_spec.substr(path_component.start, |
| + path_component.len); |
| + if (path == kPathWildcard) |
|
markusheintz_
2012/01/09 15:01:00
see comment above.
change to:
if(path.substr(1) =
Francois
2012/01/09 15:33:01
Done.
|
| + builder->WithPathWildcard(); |
| + else |
| + builder->WithPath(path); |
| } |
| } |
| @@ -194,8 +201,12 @@ |
| if (!parts.is_scheme_wildcard) |
| str += parts.scheme + chrome::kStandardSchemeSeparator; |
| - if (parts.scheme == std::string(chrome::kFileScheme)) |
| - return str + parts.path; |
| + if (parts.scheme == std::string(chrome::kFileScheme)) { |
| + if (parts.is_path_wildcard) |
| + return str + kPathWildcard; |
|
markusheintz_
2012/01/09 15:01:00
see comment above.
pls change to;
return str + kU
Francois
2012/01/09 15:33:01
Done.
|
| + else |
| + return str + parts.path; |
| + } |
| if (parts.has_domain_wildcard) { |
| if (parts.host.empty()) |