Index: components/omnibox/browser/autocomplete_match.h |
diff --git a/components/omnibox/browser/autocomplete_match.h b/components/omnibox/browser/autocomplete_match.h |
index 9c0a1320d64dd2341f5f71d69f75183035e4d520..2e409a79deebdd3b290db163e47184491acdd0f5 100644 |
--- a/components/omnibox/browser/autocomplete_match.h |
+++ b/components/omnibox/browser/autocomplete_match.h |
@@ -12,6 +12,7 @@ |
#include <string> |
#include <vector> |
+#include "base/strings/utf_offset_string_conversions.h" |
Justin Donnelly
2017/06/20 17:31:01
Can you forward declare base::OffsetAdjuster::Adju
tommycli
2017/06/20 22:51:21
Unfortunately it's not possible to forward declare
|
#include "components/omnibox/browser/autocomplete_input.h" |
#include "components/omnibox/browser/autocomplete_match_type.h" |
#include "components/search_engines/template_url.h" |
@@ -207,6 +208,20 @@ struct AutocompleteMatch { |
TemplateURLService* template_url_service, |
const base::string16& keyword); |
+ // These are convenience functions for formatting a URL into an abridged form |
+ // for display within the Omnibox suggestions dropdown. |
+ // |
+ // The results are explicitly for non-security surfaces. Do not use the |
+ // results for anything other than the Omnibox dropdown. |
+ static base::string16 FormatUrlForSuggestionDisplay( |
+ const GURL& url, |
+ bool trim_scheme, |
+ size_t* offset_for_adjustment); |
+ static base::string16 FormatUrlForSuggestionDisplayWithAdjustments( |
+ const GURL& url, |
+ bool trim_scheme, |
+ base::OffsetAdjuster::Adjustments* adjustments); |
+ |
// Computes the stripped destination URL (via GURLToStrippedGURL()) and |
// stores the result in |stripped_destination_url|. |input| is used for the |
// same purpose as in GURLToStrippedGURL(). |