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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/gtest_prod_util.h" |
12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
13 #include "components/omnibox/autocomplete_match.h" | 14 #include "components/omnibox/autocomplete_match.h" |
14 #include "components/omnibox/autocomplete_match_type.h" | 15 #include "components/omnibox/autocomplete_match_type.h" |
15 #include "url/gurl.h" | 16 #include "url/gurl.h" |
16 | 17 |
17 class AutocompleteInput; | 18 class AutocompleteInput; |
18 class AutocompleteSchemeClassifier; | 19 class AutocompleteSchemeClassifier; |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class DictionaryValue; | 22 class DictionaryValue; |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 static bool ParseSuggestResults( | 275 static bool ParseSuggestResults( |
275 const base::Value& root_val, | 276 const base::Value& root_val, |
276 const AutocompleteInput& input, | 277 const AutocompleteInput& input, |
277 const AutocompleteSchemeClassifier& scheme_classifier, | 278 const AutocompleteSchemeClassifier& scheme_classifier, |
278 int default_result_relevance, | 279 int default_result_relevance, |
279 const std::string& languages, | 280 const std::string& languages, |
280 bool is_keyword_result, | 281 bool is_keyword_result, |
281 Results* results); | 282 Results* results); |
282 | 283 |
283 private: | 284 private: |
| 285 FRIEND_TEST_ALL_PREFIXES(SearchSuggestionParser, |
| 286 GetAnswersImageURLsWithoutImagelines); |
| 287 FRIEND_TEST_ALL_PREFIXES(SearchSuggestionParser, |
| 288 GetAnswersImageURLsWithValidImage); |
| 289 |
284 // Gets URLs of any images in Answers results. | 290 // Gets URLs of any images in Answers results. |
285 static void GetAnswersImageURLs(const base::DictionaryValue* answer_json, | 291 static void GetAnswersImageURLs(const base::DictionaryValue* answer_json, |
286 std::vector<GURL>* urls); | 292 std::vector<GURL>* urls); |
287 | 293 |
288 DISALLOW_COPY_AND_ASSIGN(SearchSuggestionParser); | 294 DISALLOW_COPY_AND_ASSIGN(SearchSuggestionParser); |
289 }; | 295 }; |
290 | 296 |
291 #endif // COMPONENTS_OMNIBOX_SEARCH_SUGGESTION_PARSER_H_ | 297 #endif // COMPONENTS_OMNIBOX_SEARCH_SUGGESTION_PARSER_H_ |
OLD | NEW |