Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / components / omnibox / search_suggestion_parser.h
index f65a0ba..8e8ba3d 100644 (file)
@@ -9,6 +9,7 @@
 #include <vector>
 
 #include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
 #include "base/strings/string16.h"
 #include "components/omnibox/autocomplete_match.h"
 #include "components/omnibox/autocomplete_match_type.h"
@@ -54,6 +55,13 @@ class SearchSuggestionParser {
     AutocompleteMatchType::Type type() const { return type_; }
     int relevance() const { return relevance_; }
     void set_relevance(int relevance) { relevance_ = relevance; }
+    bool received_after_last_keystroke() const {
+      return received_after_last_keystroke_;
+    }
+    void set_received_after_last_keystroke(
+        bool received_after_last_keystroke) {
+      received_after_last_keystroke_ = received_after_last_keystroke;
+    }
 
     bool relevance_from_server() const { return relevance_from_server_; }
     void set_relevance_from_server(bool relevance_from_server) {
@@ -90,6 +98,11 @@ class SearchSuggestionParser {
     // there.
     bool relevance_from_server_;
 
+    // Whether this result was received asynchronously after the last
+    // keystroke, otherwise it must have come from prior cached results
+    // or from a synchronous provider.
+    bool received_after_last_keystroke_;
+
     // Optional deletion URL provided with suggestions. Fetching this URL
     // should result in some reasonable deletion behaviour on the server,
     // e.g. deleting this term out of a user's server-side search history.
@@ -281,6 +294,11 @@ class SearchSuggestionParser {
       Results* results);
 
  private:
+  FRIEND_TEST_ALL_PREFIXES(SearchSuggestionParser,
+                           GetAnswersImageURLsWithoutImagelines);
+  FRIEND_TEST_ALL_PREFIXES(SearchSuggestionParser,
+                           GetAnswersImageURLsWithValidImage);
+
   // Gets URLs of any images in Answers results.
   static void GetAnswersImageURLs(const base::DictionaryValue* answer_json,
                                   std::vector<GURL>* urls);