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

Unified Diff: components/omnibox/autocomplete_match.h

Issue 1206673002: Omnibox: Bug Fixes for Reverse Title (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HasMatch -> HasMatchStyle Created 5 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 | « chrome/browser/ui/views/omnibox/omnibox_result_view.cc ('k') | components/omnibox/autocomplete_match.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/autocomplete_match.h
diff --git a/components/omnibox/autocomplete_match.h b/components/omnibox/autocomplete_match.h
index 53fa3417db5cdf03c1460ecc2e346acc679887ce..fc460dcfd37e5ad3eba49a44048b2854ce704d3f 100644
--- a/components/omnibox/autocomplete_match.h
+++ b/components/omnibox/autocomplete_match.h
@@ -153,6 +153,9 @@ struct AutocompleteMatch {
size_t offset,
int style);
+ // Returns true if at least one style in |classifications| is of type MATCH.
+ static bool HasMatchStyle(const ACMatchClassifications& classifications);
+
// Removes invalid characters from |text|. Should be called on strings coming
// from external sources (such as extensions) before assigning to |contents|
// or |description|.
@@ -263,10 +266,11 @@ struct AutocompleteMatch {
// Swaps the contents and description fields, and their associated
// classifications, if this is a match for which we should emphasize the
// title (stored in the description field) over the URL (in the contents
- // field). See the implementation for the conditions under which this is
- // true.
- void PossiblySwapContentsAndDescriptionForURLSuggestion(
- const AutocompleteInput& input);
+ // field). Intended to only be used at the UI level before displaying, lest
+ // other omnibox systems get confused about which is which. See the code
+ // that sets |swap_contents_and_description| for conditions under which
+ // it is true.
+ void PossiblySwapContentsAndDescriptionForDisplay();
// The provider of this match, used to remember which provider the user had
// selected when the input changes. This may be NULL, in which case there is
@@ -327,6 +331,10 @@ struct AutocompleteMatch {
base::string16 description;
ACMatchClassifications description_class;
+ // If true, UI-level code should swap the contents and description fields
+ // before displaying.
+ bool swap_contents_and_description;
+
// TODO(jdonnelly): Remove the first two properties once the downstream
// clients are using the SuggestionAnswer.
// A rich-format version of the display for the dropdown.
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_result_view.cc ('k') | components/omnibox/autocomplete_match.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698