Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
|
Mark P
2017/01/06 06:06:09
Please use the correct year in this new file and i
mattreynolds
2017/01/06 18:03:50
Happy New Year!
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_TITLED_URL_MATCH_UTILS_H_ | |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_TITLED_URL_MATCH_UTILS_H_ | |
| 7 | |
| 8 #include "base/strings/string16.h" | |
| 9 #include "components/bookmarks/browser/titled_url_match.h" | |
| 10 #include "components/omnibox/browser/autocomplete_match_type.h" | |
| 11 | |
| 12 class AutocompleteInput; | |
| 13 class AutocompleteProvider; | |
| 14 class AutocompleteSchemeClassifier; | |
| 15 struct AutocompleteMatch; | |
| 16 | |
| 17 namespace bookmarks { | |
| 18 | |
| 19 // Compose an AutocompleteMatch based on |match| that has the match's URL and | |
| 20 // page title, type |type|, and relevance score |relevance|. |input| is used to | |
| 21 // compute the match's inline_autocompletion. |fixed_up_input_text| is used in | |
| 22 // that way as well; it's passed separately so this function doesn't have to | |
| 23 // compute it. | |
| 24 AutocompleteMatch TitledUrlMatchToAutocompleteMatch( | |
| 25 const TitledUrlMatch& match, | |
| 26 AutocompleteMatchType::Type type, | |
| 27 int relevance, | |
| 28 AutocompleteProvider* provider, | |
| 29 const AutocompleteSchemeClassifier& scheme_classifier, | |
| 30 const AutocompleteInput& input, | |
| 31 const base::string16& fixed_up_input_text); | |
| 32 | |
| 33 // Removes leading spaces from |title| before displaying, otherwise it looks | |
| 34 // funny. In the process, corrects |title_match_positions| so the correct | |
| 35 // characters are highlighted. | |
| 36 void CorrectTitleAndMatchPositions( | |
| 37 base::string16* title, | |
| 38 TitledUrlMatch::MatchPositions* title_match_positions); | |
| 39 | |
| 40 } // namespace bookmarks | |
| 41 | |
| 42 #endif // COMPONENTS_OMNIBOX_BROWSER_TITLED_URL_MATCH_UTILS_H_ | |
| OLD | NEW |