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

Unified Diff: chrome/common/content_settings_pattern.cc

Issue 254763005: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve a merge conflict. 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/common/content_settings_helper.cc ('k') | chrome/common/net/url_fixer_upper.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 340a2116960a25a6ccd619da861f8284a9c400d9..bfaa66ef26b9a0cfd79eec5c5b88ffbbfc576f70 100644
--- a/chrome/common/content_settings_pattern.cc
+++ b/chrome/common/content_settings_pattern.cc
@@ -22,9 +22,9 @@
namespace {
std::string GetDefaultPort(const std::string& scheme) {
- if (scheme == content::kHttpScheme)
+ if (scheme == url::kHttpScheme)
return "80";
- if (scheme == content::kHttpsScheme)
+ if (scheme == url::kHttpsScheme)
return "443";
return std::string();
}
@@ -243,8 +243,8 @@ bool ContentSettingsPattern::Builder::Validate(const PatternParts& parts) {
// Test if the scheme is supported or a wildcard.
if (!parts.is_scheme_wildcard &&
- parts.scheme != std::string(content::kHttpScheme) &&
- parts.scheme != std::string(content::kHttpsScheme)) {
+ parts.scheme != std::string(url::kHttpScheme) &&
+ parts.scheme != std::string(url::kHttpsScheme)) {
return false;
}
return true;
@@ -278,8 +278,8 @@ bool ContentSettingsPattern::Builder::LegacyValidate(
// Test if the scheme is supported or a wildcard.
if (!parts.is_scheme_wildcard &&
- parts.scheme != std::string(content::kHttpScheme) &&
- parts.scheme != std::string(content::kHttpsScheme)) {
+ parts.scheme != std::string(url::kHttpScheme) &&
+ parts.scheme != std::string(url::kHttpsScheme)) {
return false;
}
return true;
@@ -339,18 +339,18 @@ ContentSettingsPattern ContentSettingsPattern::FromURL(
// also have a "http" scheme.
if (local_url->HostIsIPAddress()) {
builder->WithScheme(local_url->scheme())->WithHost(local_url->host());
- } else if (local_url->SchemeIs(content::kHttpScheme)) {
+ } else if (local_url->SchemeIs(url::kHttpScheme)) {
builder->WithSchemeWildcard()->WithDomainWildcard()->WithHost(
local_url->host());
- } else if (local_url->SchemeIs(content::kHttpsScheme)) {
+ } else if (local_url->SchemeIs(url::kHttpsScheme)) {
builder->WithScheme(local_url->scheme())->WithDomainWildcard()->WithHost(
local_url->host());
} else {
// Unsupported scheme
}
if (local_url->port().empty()) {
- if (local_url->SchemeIs(content::kHttpsScheme))
- builder->WithPort(GetDefaultPort(content::kHttpsScheme));
+ if (local_url->SchemeIs(url::kHttpsScheme))
+ builder->WithPort(GetDefaultPort(url::kHttpsScheme));
else
builder->WithPortWildcard();
} else {
« no previous file with comments | « chrome/common/content_settings_helper.cc ('k') | chrome/common/net/url_fixer_upper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698