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

Unified Diff: chrome/common/content_settings_pattern.cc

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing files. Created 6 years, 7 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 | « chrome/browser/web_applications/web_app.cc ('k') | chrome/common/content_settings_pattern_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/content_settings_pattern.cc
diff --git a/chrome/common/content_settings_pattern.cc b/chrome/common/content_settings_pattern.cc
index bfaa66ef26b9a0cfd79eec5c5b88ffbbfc576f70..f0b12a0ce2cde2ed7948472d8210ad32a536b16c 100644
--- a/chrome/common/content_settings_pattern.cc
+++ b/chrome/common/content_settings_pattern.cc
@@ -179,11 +179,11 @@ bool ContentSettingsPattern::Builder::Canonicalize(PatternParts* parts) {
const std::string scheme(StringToLowerASCII(parts->scheme));
parts->scheme = scheme;
- if (parts->scheme == std::string(content::kFileScheme) &&
+ if (parts->scheme == std::string(url::kFileScheme) &&
!parts->is_path_wildcard) {
- GURL url(std::string(content::kFileScheme) +
- std::string(content::kStandardSchemeSeparator) + parts->path);
- parts->path = url.path();
+ GURL url(std::string(url::kFileScheme) +
+ std::string(content::kStandardSchemeSeparator) + parts->path);
+ parts->path = url.path();
}
// Canonicalize the host part.
@@ -213,7 +213,7 @@ bool ContentSettingsPattern::Builder::Validate(const PatternParts& parts) {
}
// file:// URL patterns have an empty host and port.
- if (parts.scheme == std::string(content::kFileScheme)) {
+ if (parts.scheme == std::string(url::kFileScheme)) {
if (parts.has_domain_wildcard || !parts.host.empty() || !parts.port.empty())
return false;
if (parts.is_path_wildcard)
@@ -254,7 +254,7 @@ bool ContentSettingsPattern::Builder::Validate(const PatternParts& parts) {
bool ContentSettingsPattern::Builder::LegacyValidate(
const PatternParts& parts) {
// If the pattern is for a "file-pattern" test if it is valid.
- if (parts.scheme == std::string(content::kFileScheme) &&
+ if (parts.scheme == std::string(url::kFileScheme) &&
!parts.is_scheme_wildcard &&
parts.host.empty() &&
parts.port.empty())
@@ -457,7 +457,7 @@ bool ContentSettingsPattern::Matches(
// TODO(markusheintz): Content settings should be defined for all files on
// a machine. Unless there is a good use case for supporting paths for file
// patterns, stop supporting path for file patterns.
- if (!parts_.is_scheme_wildcard && scheme == content::kFileScheme)
+ if (!parts_.is_scheme_wildcard && scheme == url::kFileScheme)
return parts_.is_path_wildcard ||
parts_.path == std::string(local_url->path());
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | chrome/common/content_settings_pattern_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698