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

Unified Diff: chrome/browser/autocomplete/autocomplete_provider.h

Issue 108643003: Omnibox: Bug Fixes for Shortcuts Inlining (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, post-revert Created 7 years 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 | « no previous file | chrome/browser/autocomplete/autocomplete_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_provider.h
diff --git a/chrome/browser/autocomplete/autocomplete_provider.h b/chrome/browser/autocomplete/autocomplete_provider.h
index 76d289c04632ea3806e5cbf88fcbd4e757cb0da9..b59f97abf98dbc1315a967541ccc48401b6264e2 100644
--- a/chrome/browser/autocomplete/autocomplete_provider.h
+++ b/chrome/browser/autocomplete/autocomplete_provider.h
@@ -246,6 +246,26 @@ class AutocompleteProvider
// profile's bookmark bar model.
void UpdateStarredStateOfMatches();
+ // Fixes up user URL input to make it more possible to match against. Among
+ // many other things, this takes care of the following:
+ // * Prepending file:// to file URLs
+ // * Converting drive letters in file URLs to uppercase
+ // * Converting case-insensitive parts of URLs (like the scheme and domain)
+ // to lowercase
+ // * Convert spaces to %20s
+ // Note that we don't do this in AutocompleteInput's constructor, because if
+ // e.g. we convert a Unicode hostname to punycode, other providers will show
+ // output that surprises the user ("Search Google for xn--6ca.com").
+ // Returns false if the fixup attempt resulted in an empty string (which
+ // providers generally can't do anything with).
+ static bool FixupUserInput(AutocompleteInput* input);
+
+ // Trims "http:" and up to two subsequent slashes from |url|. Returns the
+ // number of characters that were trimmed.
+ // NOTE: For a view-source: URL, this will trim from after "view-source:" and
+ // return 0.
+ static size_t TrimHttpPrefix(base::string16* url);
+
// The profile associated with the AutocompleteProvider. Reference is not
// owned by us.
Profile* profile_;
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698