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

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

Issue 269293002: [AiS] Added version parameter to search query. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « chrome/browser/search_engines/prepopulated_engines.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url.cc
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index 501b7989e44816bed5d46828a94a22b1aefe07e6..6de18cb21b32ed4e57102da146f9720a2ac2fbda 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -84,6 +84,9 @@ const char kGoogleRLZParameter[] = "google:RLZ";
const char kGoogleSearchClient[] = "google:searchClient";
const char kGoogleSearchFieldtrialParameter[] =
"google:searchFieldtrialParameter";
+#if defined (OS_ANDROID)
+const char kGoogleSearchVersion[] = "google:searchVersion";
+#endif
const char kGoogleSourceIdParameter[] = "google:sourceId";
const char kGoogleSuggestAPIKeyParameter[] = "google:suggestAPIKeyParameter";
const char kGoogleSuggestClient[] = "google:suggestClient";
@@ -601,6 +604,13 @@ bool TemplateURLRef::ParseParameter(size_t start,
replacements->push_back(Replacement(GOOGLE_SEARCH_CLIENT, start));
} else if (parameter == kGoogleSearchFieldtrialParameter) {
replacements->push_back(Replacement(GOOGLE_SEARCH_FIELDTRIAL_GROUP, start));
+#if defined(OS_ANDROID)
+ } else if (parameter == kGoogleSearchVersion) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAnswersInSuggest)) {
Peter Kasting 2014/05/07 00:01:52 Nit: Indent 4, not 8; no {}
groby-ooo-7-16 2014/05/07 01:32:31 Fixed. (Style guide & git cl format disagree, bu
Peter Kasting 2014/05/07 01:35:45 The style guide doesn't disagree AFAIK. clang-for
+ url->insert(start, "gs_rn=42");
Peter Kasting 2014/05/07 00:01:52 Doesn't this need a trailing '&'?
groby-ooo-7-16 2014/05/07 01:32:31 Indeed, done.
+ }
+#endif
} else if (parameter == kGoogleSourceIdParameter) {
#if defined(OS_ANDROID)
url->insert(start, "sourceid=chrome-mobile&");
« no previous file with comments | « chrome/browser/search_engines/prepopulated_engines.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698