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

Side by Side Diff: components/omnibox/search_suggestion_parser.h

Issue 470403003: [AiS] Fix parsing for Answers Images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
OLDNEW
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
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);
Mark P 2014/08/15 22:49:16 nit: can't you do this with only one line GetAnswe
groby-ooo-7-16 2014/08/22 00:43:58 Unfortunately not - it just makes sure MAYBE_ and
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698