Index: chrome/browser/search_engines/template_url.h |
diff --git a/chrome/browser/search_engines/template_url.h b/chrome/browser/search_engines/template_url.h |
index 67f27cacea1cc0e39eaa7ab49d562489c9c2ea45..5c59cc61d48a6cd4555e7dd9cb8bea972ef5a9ff 100644 |
--- a/chrome/browser/search_engines/template_url.h |
+++ b/chrome/browser/search_engines/template_url.h |
@@ -53,6 +53,7 @@ class TemplateURLRef { |
INSTANT, |
IMAGE, |
NEW_TAB, |
+ CONTEXTUAL_SEARCH, |
INDEXED |
}; |
@@ -70,6 +71,31 @@ class TemplateURLRef { |
explicit SearchTermsArgs(const base::string16& search_terms); |
~SearchTermsArgs(); |
+ struct ContextualSearchParams { |
+ ContextualSearchParams(); |
+ |
+ // The version of contextual search. |
+ int version; |
+ |
+ // Offset into content of the start of the user selection. |
Peter Kasting
2014/06/06 17:51:33
Nit: Should "content" be "the page content" everyw
jeremycho
2014/06/06 21:51:45
Done.
|
+ size_t start; |
+ |
+ // Offset into content of the end of the user selection. |
+ size_t end; |
+ |
+ // The user selection. |
+ std::string selection; |
+ |
+ // The text including and surrounding the user selection. |
+ std::string content; |
+ |
+ // The URL of the page containing the user selection. |
+ std::string base_page_url; |
+ |
+ // The encoding of content. |
+ std::string encoding; |
+ }; |
+ |
// The search terms (query). |
base::string16 search_terms; |
@@ -140,6 +166,8 @@ class TemplateURLRef { |
// True if the search was made using the app list search box. Otherwise, the |
// search was made using the omnibox. |
bool from_app_list; |
+ |
+ ContextualSearchParams contextual_search_params; |
}; |
TemplateURLRef(TemplateURL* owner, Type type); |
@@ -271,6 +299,8 @@ class TemplateURLRef { |
GOOGLE_INSTANT_EXTENDED_ENABLED, |
GOOGLE_NTP_IS_THEMED, |
GOOGLE_OMNIBOX_START_MARGIN, |
+ GOOGLE_CONTEXTUAL_SEARCH_VERSION, |
+ GOOGLE_CONTEXTUAL_SEARCH_CONTEXT_DATA, |
Peter Kasting
2014/06/06 17:51:33
Nit: Should this just be named GOOGLE_CONTEXTUAL_S
jeremycho
2014/06/06 21:51:45
The struct also contains version, which is why I n
|
GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION, |
GOOGLE_PAGE_CLASSIFICATION, |
GOOGLE_RLZ, |
@@ -444,6 +474,7 @@ struct TemplateURLData { |
std::string instant_url; |
std::string image_url; |
std::string new_tab_url; |
+ std::string contextual_search_url; |
// The following post_params are comma-separated lists used to specify the |
// post parameters for the corresponding URL. |
@@ -591,6 +622,9 @@ class TemplateURL { |
const std::string& instant_url() const { return data_.instant_url; } |
const std::string& image_url() const { return data_.image_url; } |
const std::string& new_tab_url() const { return data_.new_tab_url; } |
+ const std::string& contextual_search_url() const { |
+ return data_.contextual_search_url; |
+ } |
const std::string& search_url_post_params() const { |
return data_.search_url_post_params; |
} |
@@ -646,6 +680,9 @@ class TemplateURL { |
const TemplateURLRef& instant_url_ref() const { return instant_url_ref_; } |
const TemplateURLRef& image_url_ref() const { return image_url_ref_; } |
const TemplateURLRef& new_tab_url_ref() const { return new_tab_url_ref_; } |
+ const TemplateURLRef& contextual_search_url_ref() const { |
+ return contextual_search_url_ref_; |
+ } |
// Returns true if |url| supports replacement. |
bool SupportsReplacement() const; |
@@ -776,6 +813,7 @@ class TemplateURL { |
TemplateURLRef instant_url_ref_; |
TemplateURLRef image_url_ref_; |
TemplateURLRef new_tab_url_ref_; |
+ TemplateURLRef contextual_search_url_ref_; |
scoped_ptr<AssociatedExtensionInfo> extension_info_; |
// TODO(sky): Add date last parsed OSD file. |