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

Unified Diff: chrome/browser/search/search.cc

Issue 151813002: Adds InstantExtendedEnabledParam to the search request URL iff the query extraction flag is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment Created 6 years, 10 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/search.cc
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index 1562d527433f530e9a6c3cfc56476a7ca89db780..f3c802320f7b0a0733aa88c532ccf19d6e19c29c 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -362,6 +362,17 @@ uint64 EmbeddedSearchPageVersion() {
return kEmbeddedPageVersionDefault;
}
+std::string InstantExtendedEnabledParam(bool for_search) {
+#if !defined(OS_IOS) && !defined(OS_ANDROID)
samarth 2014/02/04 17:17:05 Why are these ifdefs necessary? IsQueryExtraction
kmadhusu 2014/02/04 17:49:59 ifdefs are not required here. Since I passed "fals
kmadhusu 2014/02/04 19:39:54 Removed.
+ // On mobile, query extraction is always enabled.
+ if (for_search && !chrome::IsQueryExtractionEnabled())
+ return std::string();
+#endif
+
+ return std::string(google_util::kInstantExtendedAPIParam) + "=" +
+ base::Uint64ToString(EmbeddedSearchPageVersion()) + "&";
+}
+
bool IsQueryExtractionEnabled() {
#if defined(OS_IOS) || defined(OS_ANDROID)
return true;

Powered by Google App Engine
This is Rietveld 408576698