Index: chrome/browser/autocomplete/autocomplete.cc |
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc |
index 260d72e773899cca84ab3f3b4005a56324ffadda..e7de496a1a3c6a208c4236b05525e8889fc93827 100644 |
--- a/chrome/browser/autocomplete/autocomplete.cc |
+++ b/chrome/browser/autocomplete/autocomplete.cc |
@@ -90,6 +90,7 @@ AutocompleteInput::AutocompleteInput(const string16& text, |
if (((type_ == UNKNOWN) || (type_ == REQUESTED_URL) || (type_ == URL)) && |
canonicalized_url.is_valid() && |
(!canonicalized_url.IsStandard() || canonicalized_url.SchemeIsFile() || |
+ canonicalized_url.SchemeIsFileSystem() || |
!canonicalized_url.host().empty())) |
canonicalized_url_ = canonicalized_url; |
@@ -152,6 +153,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( |
if (canonicalized_url) { |
*canonicalized_url = URLFixerUpper::FixupURL(UTF16ToUTF8(text), |
UTF16ToUTF8(desired_tld)); |
+ return URL; |
} |
if (LowerCaseEqualsASCII(parsed_scheme, chrome::kFileScheme)) { |
@@ -161,6 +163,15 @@ AutocompleteInput::Type AutocompleteInput::Parse( |
return URL; |
} |
+ if (LowerCaseEqualsASCII(parsed_scheme, chrome::kFileSystemScheme)) { |
+ // This could theoretically be a strange search, but let's check. |
+ ParseFileSystemURL(text.data(), text.length(), parts); |
+ // If it's got an inner_url with a scheme, it's a URL, whether it's valid or |
+ // not. |
+ if (parts->inner_parsed() && parts->inner_parsed()->scheme.is_valid()) |
+ return URL; |
+ } |
+ |
// If the user typed a scheme, and it's HTTP or HTTPS, we know how to parse it |
// well enough that we can fall through to the heuristics below. If it's |
// something else, we can just determine our action based on what we do with |
@@ -450,6 +461,9 @@ void AutocompleteInput::ParseForEmphasizeComponents( |
host->reset(); |
} |
} |
+ } else if (LowerCaseEqualsASCII(scheme_str, chrome::kFileSystemScheme) && |
+ parts.inner_parsed() && parts.inner_parsed()->scheme.is_valid()) { |
+ *host = parts.inner_parsed()->host; |
} |
} |