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

Unified Diff: chrome/browser/autocomplete/autocomplete.cc

Issue 7811006: Add full support for filesystem URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge errors Created 8 years, 9 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 | « build/temp_gyp/googleurl.gyp ('k') | chrome/browser/autocomplete/autocomplete_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete.cc
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 010617a9845c758f3cba72e84287e8254cf19926..0efd16d6cc2ffba99ae29b0e29bf30e210b6b41e 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -95,6 +95,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;
@@ -166,6 +167,14 @@ AutocompleteInput::Type AutocompleteInput::Parse(
return URL;
}
+ if (LowerCaseEqualsASCII(parsed_scheme, chrome::kFileSystemScheme)) {
+ // This could theoretically be a strange search, but let's check.
+ // 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
@@ -455,6 +464,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;
}
}
« no previous file with comments | « build/temp_gyp/googleurl.gyp ('k') | chrome/browser/autocomplete/autocomplete_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698