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

Unified Diff: chrome/browser/search_engines/template_url.h

Issue 308053009: Add contextual search to the template url system (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
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..7762d6ed338a8e7c38221d8001a4f8bf51576ecd 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
};
@@ -95,6 +96,24 @@ class TemplateURLRef {
// to align the preview contents with the omnibox.
int omnibox_start_margin;
+ // The version of contextual search.
+ int contextual_search_version;
+
+ // Offset into contextual_search_content of the start of the user selection.
+ int contextual_search_start;
+
+ // Offset into contextual_search_content of the end of the user selection.
+ int contextual_search_end;
+
+ // The text including and surrounding the user selection.
+ std::string contextual_search_content;
+
+ // The URL of the page containing the user selection.
+ std::string contextual_search_base_page_url;
+
+ // The encoding of contextual_search_content.
+ std::string contextual_search_encoding;
+
Peter Kasting 2014/06/03 21:47:09 Maybe all these should be in some sub-struct to gr
jeremycho 2014/06/04 00:22:11 Done. On 2014/06/03 21:47:09, Peter Kasting wrote
// The URL of the current webpage to be used for experimental zero-prefix
// suggestions.
std::string current_page_url;
@@ -271,6 +290,12 @@ class TemplateURLRef {
GOOGLE_INSTANT_EXTENDED_ENABLED,
GOOGLE_NTP_IS_THEMED,
GOOGLE_OMNIBOX_START_MARGIN,
+ GOOGLE_CONTEXTUAL_SEARCH_VERSION,
+ GOOGLE_CONTEXTUAL_SEARCH_START,
+ GOOGLE_CONTEXTUAL_SEARCH_END,
+ GOOGLE_CONTEXTUAL_SEARCH_CONTENT,
+ GOOGLE_CONTEXTUAL_SEARCH_BASE_PAGE_URL,
+ GOOGLE_CONTEXTUAL_SEARCH_ENCODING,
GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION,
GOOGLE_PAGE_CLASSIFICATION,
GOOGLE_RLZ,
@@ -444,6 +469,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 +617,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 +675,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 +808,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.

Powered by Google App Engine
This is Rietveld 408576698