Index: chrome/browser/net/url_fixer_upper.cc |
=================================================================== |
--- chrome/browser/net/url_fixer_upper.cc (revision 88158) |
+++ chrome/browser/net/url_fixer_upper.cc (working copy) |
@@ -406,10 +406,10 @@ |
chrome::kFtpScheme : chrome::kHttpScheme); |
} |
- // Proceed with about and chrome schemes, but not file or nonstandard schemes. |
- if ((scheme != chrome::kAboutScheme) && (scheme != chrome::kChromeUIScheme) && |
- ((scheme == chrome::kFileScheme) || !url_util::IsStandard(scheme.c_str(), |
- url_parse::Component(0, static_cast<int>(scheme.length()))))) |
+ // Not segmenting file schemes or nonstandard schemes. |
+ if ((scheme == chrome::kFileScheme) || |
+ !url_util::IsStandard(scheme.c_str(), |
+ url_parse::Component(0, static_cast<int>(scheme.length())))) |
return scheme; |
if (parts->scheme.is_valid()) { |
@@ -427,7 +427,7 @@ |
// Construct the text to parse by inserting the scheme. |
std::string inserted_text(scheme); |
- inserted_text.append(chrome::kStandardSchemeSeparator); |
+ inserted_text.append("://"); |
std::string text_to_parse(text.begin(), first_nonwhite); |
text_to_parse.append(inserted_text); |
text_to_parse.append(first_nonwhite, text.end()); |
@@ -478,16 +478,11 @@ |
if (scheme == chrome::kFileScheme) |
return GURL(parts.scheme.is_valid() ? text : FixupPath(text)); |
- // Parse and rebuild about: and chrome: URLs, except about:blank. |
- bool chrome_url = !LowerCaseEqualsASCII(trimmed, chrome::kAboutBlankURL) && |
- ((scheme == chrome::kAboutScheme) || (scheme == chrome::kChromeUIScheme)); |
- |
// For some schemes whose layouts we understand, we rebuild it. |
- if (chrome_url || url_util::IsStandard(scheme.c_str(), |
+ if (url_util::IsStandard(scheme.c_str(), |
url_parse::Component(0, static_cast<int>(scheme.length())))) { |
- // Replace the about: scheme with the chrome: scheme. |
- std::string url(chrome_url ? chrome::kChromeUIScheme : scheme); |
- url.append(chrome::kStandardSchemeSeparator); |
+ std::string url(scheme); |
+ url.append("://"); |
// We need to check whether the |username| is valid because it is our |
// responsibility to append the '@' to delineate the user information from |
@@ -499,8 +494,6 @@ |
} |
FixupHost(trimmed, parts.host, parts.scheme.is_valid(), desired_tld, &url); |
- if (chrome_url && !parts.host.is_valid()) |
- url.append(chrome::kChromeUIDefaultHost); |
FixupPort(trimmed, parts.port, &url); |
FixupPath(trimmed, parts.path, &url); |
FixupQuery(trimmed, parts.query, &url); |
@@ -512,7 +505,7 @@ |
// In the worst-case, we insert a scheme if the URL lacks one. |
if (!parts.scheme.is_valid()) { |
std::string fixed_scheme(scheme); |
- fixed_scheme.append(chrome::kStandardSchemeSeparator); |
+ fixed_scheme.append("://"); |
trimmed.insert(0, fixed_scheme); |
} |