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

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: Rebase and address some style nits. Created 6 years, 8 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
Index: chrome/common/content_settings_pattern.cc
diff --git a/chrome/common/content_settings_pattern.cc b/chrome/common/content_settings_pattern.cc
index 4f49a676f24738c731c76385a8f510b931c74277..3dfa1adf62f5bc531d17d19a131519a00dc0c2ea 100644
--- a/chrome/common/content_settings_pattern.cc
+++ b/chrome/common/content_settings_pattern.cc
@@ -16,15 +16,16 @@
#include "ipc/ipc_message_utils.h"
#include "net/base/dns_util.h"
#include "net/base/net_util.h"
+#include "net/base/url_constants.h"
#include "url/gurl.h"
#include "url/url_canon.h"
namespace {
std::string GetDefaultPort(const std::string& scheme) {
- if (scheme == content::kHttpScheme)
+ if (scheme == net::kHttpScheme)
return "80";
- if (scheme == content::kHttpsScheme)
+ if (scheme == net::kHttpsScheme)
return "443";
return std::string();
}
@@ -243,8 +244,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(net::kHttpScheme) &&
+ parts.scheme != std::string(net::kHttpsScheme)) {
return false;
}
return true;
@@ -278,8 +279,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(net::kHttpScheme) &&
+ parts.scheme != std::string(net::kHttpsScheme)) {
return false;
}
return true;
@@ -339,18 +340,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(net::kHttpScheme)) {
builder->WithSchemeWildcard()->WithDomainWildcard()->WithHost(
local_url->host());
- } else if (local_url->SchemeIs(content::kHttpsScheme)) {
+ } else if (local_url->SchemeIs(net::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(net::kHttpsScheme))
+ builder->WithPort(GetDefaultPort(net::kHttpsScheme));
else
builder->WithPortWildcard();
} else {

Powered by Google App Engine
This is Rietveld 408576698