| Index: chrome/common/content_settings_pattern_parser.cc
|
| diff --git a/chrome/common/content_settings_pattern_parser.cc b/chrome/common/content_settings_pattern_parser.cc
|
| index e54834a3cbba6a6120964d29a5d8c51ba8bfb39d..7a9c383ae32dfd60b76e40b6dc69d8cfc6b6e7a9 100644
|
| --- a/chrome/common/content_settings_pattern_parser.cc
|
| +++ b/chrome/common/content_settings_pattern_parser.cc
|
| @@ -42,6 +42,8 @@ const char* PatternParser::kHostWildcard = "*";
|
|
|
| const char* PatternParser::kPortWildcard = "*";
|
|
|
| +const char* PatternParser::kPathWildcard = "*";
|
| +
|
| // static
|
| void PatternParser::Parse(const std::string& pattern_spec,
|
| ContentSettingsPattern::BuilderInterface* builder) {
|
| @@ -169,13 +171,18 @@ void PatternParser::Parse(const std::string& pattern_spec,
|
| 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.substr(1) == kPathWildcard)
|
| + builder->WithPathWildcard();
|
| + else
|
| + builder->WithPath(path);
|
| }
|
| }
|
|
|
| @@ -194,8 +201,12 @@ std::string PatternParser::ToString(
|
| if (!parts.is_scheme_wildcard)
|
| str += parts.scheme + chrome::kStandardSchemeSeparator;
|
|
|
| - if (parts.scheme == std::string(chrome::kFileScheme))
|
| - return str + parts.path;
|
| + if (parts.scheme == chrome::kFileScheme) {
|
| + if (parts.is_path_wildcard)
|
| + return str + kUrlPathSeparator + kPathWildcard;
|
| + else
|
| + return str + parts.path;
|
| + }
|
|
|
| if (parts.has_domain_wildcard) {
|
| if (parts.host.empty())
|
|
|