Index: components/omnibox/search_suggestion_parser.h |
diff --git a/components/omnibox/search_suggestion_parser.h b/components/omnibox/search_suggestion_parser.h |
index f5493f190c24498310a18d04fa9bf2e0759c86f4..68c17c608aa464b1ff413b495a79a97a66e238eb 100644 |
--- a/components/omnibox/search_suggestion_parser.h |
+++ b/components/omnibox/search_suggestion_parser.h |
@@ -13,6 +13,7 @@ |
#include "base/strings/string16.h" |
#include "components/omnibox/autocomplete_match.h" |
#include "components/omnibox/autocomplete_match_type.h" |
+#include "components/omnibox/suggestion_answer.h" |
#include "url/gurl.h" |
class AutocompleteInput; |
@@ -118,6 +119,7 @@ class SearchSuggestionParser { |
const base::string16& annotation, |
const base::string16& answer_contents, |
const base::string16& answer_type, |
+ scoped_ptr<SuggestionAnswer> answer, |
const std::string& suggest_query_params, |
const std::string& deletion_url, |
bool from_keyword_provider, |
@@ -125,8 +127,11 @@ class SearchSuggestionParser { |
bool relevance_from_server, |
bool should_prefetch, |
const base::string16& input_text); |
+ SuggestResult(const SuggestResult& result); |
virtual ~SuggestResult(); |
+ SuggestResult& operator=(const SuggestResult& result); |
+ |
const base::string16& suggestion() const { return suggestion_; } |
const base::string16& match_contents_prefix() const { |
return match_contents_prefix_; |
@@ -138,6 +143,7 @@ class SearchSuggestionParser { |
const base::string16& answer_contents() const { return answer_contents_; } |
const base::string16& answer_type() const { return answer_type_; } |
+ const SuggestionAnswer* answer() const { return answer_.get(); } |
bool should_prefetch() const { return should_prefetch_; } |
@@ -171,12 +177,17 @@ class SearchSuggestionParser { |
// Optional additional parameters to be added to the search URL. |
std::string suggest_query_params_; |
+ // TODO(jdonnelly): Remove the following two properties once the downstream |
+ // clients are using the SuggestionAnswer. |
// Optional formatted Answers result. |
base::string16 answer_contents_; |
// Type of optional formatted Answers result. |
base::string16 answer_type_; |
+ // Optional short answer to the input that produced this suggestion. |
+ scoped_ptr<SuggestionAnswer> answer_; |
+ |
// Should this result be prefetched? |
bool should_prefetch_; |
}; |
@@ -300,7 +311,7 @@ class SearchSuggestionParser { |
GetAnswersImageURLsWithValidImage); |
// Gets URLs of any images in Answers results. |
- static void GetAnswersImageURLs(const base::DictionaryValue* answer_json, |
+ static void GetAnswersImageURLs(const SuggestionAnswer& answer, |
std::vector<GURL>* urls); |
DISALLOW_COPY_AND_ASSIGN(SearchSuggestionParser); |