| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_OMNIBOX_SEARCH_SUGGESTION_PARSER_H_ | 5 #ifndef COMPONENTS_OMNIBOX_SEARCH_SUGGESTION_PARSER_H_ |
| 6 #define COMPONENTS_OMNIBOX_SEARCH_SUGGESTION_PARSER_H_ | 6 #define COMPONENTS_OMNIBOX_SEARCH_SUGGESTION_PARSER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Fills in |match_contents_class_| to reflect how |match_contents_| should | 144 // Fills in |match_contents_class_| to reflect how |match_contents_| should |
| 145 // be displayed and bolded against the current |input_text|. If | 145 // be displayed and bolded against the current |input_text|. If |
| 146 // |allow_bolding_all| is false and |match_contents_class_| would have all | 146 // |allow_bolding_all| is false and |match_contents_class_| would have all |
| 147 // of |match_contents_| bolded, do nothing. | 147 // of |match_contents_| bolded, do nothing. |
| 148 void ClassifyMatchContents(const bool allow_bolding_all, | 148 void ClassifyMatchContents(const bool allow_bolding_all, |
| 149 const base::string16& input_text); | 149 const base::string16& input_text); |
| 150 | 150 |
| 151 // Result: | 151 // Result: |
| 152 virtual int CalculateRelevance( | 152 virtual int CalculateRelevance( |
| 153 const AutocompleteInput& input, | 153 const AutocompleteInput& input, |
| 154 bool keyword_provider_requested) const OVERRIDE; | 154 bool keyword_provider_requested) const override; |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 // The search terms to be used for this suggestion. | 157 // The search terms to be used for this suggestion. |
| 158 base::string16 suggestion_; | 158 base::string16 suggestion_; |
| 159 | 159 |
| 160 // The contents to be displayed as prefix of match contents. | 160 // The contents to be displayed as prefix of match contents. |
| 161 // Used for postfix suggestions to display a leading ellipsis (or some | 161 // Used for postfix suggestions to display a leading ellipsis (or some |
| 162 // equivalent character) to indicate omitted text. | 162 // equivalent character) to indicate omitted text. |
| 163 // Only used to pass this information to about:omnibox's "Additional Info". | 163 // Only used to pass this information to about:omnibox's "Additional Info". |
| 164 base::string16 match_contents_prefix_; | 164 base::string16 match_contents_prefix_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // and user |languages|. If |allow_bolding_nothing| is false and | 204 // and user |languages|. If |allow_bolding_nothing| is false and |
| 205 // |match_contents_class_| would result in an entirely unbolded | 205 // |match_contents_class_| would result in an entirely unbolded |
| 206 // |match_contents_|, do nothing. | 206 // |match_contents_|, do nothing. |
| 207 void CalculateAndClassifyMatchContents(const bool allow_bolding_nothing, | 207 void CalculateAndClassifyMatchContents(const bool allow_bolding_nothing, |
| 208 const base::string16& input_text, | 208 const base::string16& input_text, |
| 209 const std::string& languages); | 209 const std::string& languages); |
| 210 | 210 |
| 211 // Result: | 211 // Result: |
| 212 virtual int CalculateRelevance( | 212 virtual int CalculateRelevance( |
| 213 const AutocompleteInput& input, | 213 const AutocompleteInput& input, |
| 214 bool keyword_provider_requested) const OVERRIDE; | 214 bool keyword_provider_requested) const override; |
| 215 | 215 |
| 216 private: | 216 private: |
| 217 // The suggested url for navigation. | 217 // The suggested url for navigation. |
| 218 GURL url_; | 218 GURL url_; |
| 219 | 219 |
| 220 // The properly formatted ("fixed up") URL string with equivalent meaning | 220 // The properly formatted ("fixed up") URL string with equivalent meaning |
| 221 // to the one in |url_|. | 221 // to the one in |url_|. |
| 222 base::string16 formatted_url_; | 222 base::string16 formatted_url_; |
| 223 | 223 |
| 224 // The suggested navigational result description; generally the site name. | 224 // The suggested navigational result description; generally the site name. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 GetAnswersImageURLsWithValidImage); | 300 GetAnswersImageURLsWithValidImage); |
| 301 | 301 |
| 302 // Gets URLs of any images in Answers results. | 302 // Gets URLs of any images in Answers results. |
| 303 static void GetAnswersImageURLs(const base::DictionaryValue* answer_json, | 303 static void GetAnswersImageURLs(const base::DictionaryValue* answer_json, |
| 304 std::vector<GURL>* urls); | 304 std::vector<GURL>* urls); |
| 305 | 305 |
| 306 DISALLOW_COPY_AND_ASSIGN(SearchSuggestionParser); | 306 DISALLOW_COPY_AND_ASSIGN(SearchSuggestionParser); |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 #endif // COMPONENTS_OMNIBOX_SEARCH_SUGGESTION_PARSER_H_ | 309 #endif // COMPONENTS_OMNIBOX_SEARCH_SUGGESTION_PARSER_H_ |
| OLD | NEW |