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

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

Issue 312423003: Cleanup AutocompleteInput and AutocompleteProvider Functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Return a std::pair Created 6 years, 6 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 | « 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 02e247e062221111c856b60afcda909ef2b6744d..7a856c8c3ae1f412d9d3bf912ad44f53b4b8bf74 100644
--- a/chrome/browser/autocomplete/autocomplete_provider.h
+++ b/chrome/browser/autocomplete/autocomplete_provider.h
@@ -241,6 +241,8 @@ class AutocompleteProvider
friend class base::RefCountedThreadSafe<AutocompleteProvider>;
FRIEND_TEST_ALL_PREFIXES(BookmarkProviderTest, InlineAutocompletion);
+ typedef std::pair<bool, base::string16> FixupReturn;
+
virtual ~AutocompleteProvider();
// Updates the starred state of each of the matches in matches_ from the
@@ -257,9 +259,11 @@ class AutocompleteProvider
// 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);
+ // Returns a bool indicating whether fixup succeeded, as well as the fixed-up
+ // input text. The returned string will be the same as the input string if
+ // fixup failed; this lets callers who don't care about failure simply use the
+ // string unconditionally.
+ static FixupReturn FixupUserInput(const AutocompleteInput& input);
// Trims "http:" and up to two subsequent slashes from |url|. Returns the
// number of characters that were trimmed.
« 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