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

Unified Diff: components/omnibox/browser/autocomplete_match.h

Issue 2963883002: Omnibox UI Experiments: Refactor HTTPS trimming into UrlFormatter. (Closed)
Patch Set: fix Created 3 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
Index: components/omnibox/browser/autocomplete_match.h
diff --git a/components/omnibox/browser/autocomplete_match.h b/components/omnibox/browser/autocomplete_match.h
index b8659cd7bb04919e3838ed14eb2a891222374afe..ffbd5c7217ea96ac7d301e6a3e2abef5c08a1b7c 100644
--- a/components/omnibox/browser/autocomplete_match.h
+++ b/components/omnibox/browser/autocomplete_match.h
@@ -16,6 +16,7 @@
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/autocomplete_match_type.h"
#include "components/search_engines/template_url.h"
+#include "components/url_formatter/url_formatter.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"
@@ -208,23 +209,10 @@ 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 FormatUrlForSuggestionDisplayWithOffsets(
- const GURL& url,
- bool trim_scheme,
- std::vector<size_t>* offsets_for_adjustment);
- static base::string16 FormatUrlForSuggestionDisplayWithAdjustments(
- const GURL& url,
- bool trim_scheme,
- base::OffsetAdjuster::Adjustments* adjustments);
+ // Gets the formatting flags used for display of suggestions. This method
+ // encapsulates the return of experimental flags too, so any URLs displayed
+ // as an Omnibox suggestion should use this method.
+ static url_formatter::FormatUrlTypes GetFormatTypes(bool trim_scheme);
// Computes the stripped destination URL (via GURLToStrippedGURL()) and
// stores the result in |stripped_destination_url|. |input| is used for the
« no previous file with comments | « chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm ('k') | components/omnibox/browser/autocomplete_match.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698