Index: chrome/browser/android/contextualsearch/contextual_search_delegate.cc |
diff --git a/chrome/browser/android/contextualsearch/contextual_search_delegate.cc b/chrome/browser/android/contextualsearch/contextual_search_delegate.cc |
index dd2c84327d5078492409dace0d43b98273bf6578..9618f075f7f636c0ae8d848804c621249864e332 100644 |
--- a/chrome/browser/android/contextualsearch/contextual_search_delegate.cc |
+++ b/chrome/browser/android/contextualsearch/contextual_search_delegate.cc |
@@ -55,6 +55,9 @@ const char kDoPreventPreloadValue[] = "1"; |
// The number of characters that should be shown after the selected expression. |
const int kSurroundingSizeForUI = 60; |
+// The version of the Now on Tap API that we want to invoke. |
+const int kNowOnTapVersion = 1; |
Peter Kasting
2016/09/15 23:05:41
Nit: Consider defining this as close to its use (i
Donn Denman
2016/09/15 23:34:25
I'd rather leave this at the top of this file, sin
|
+ |
} // namespace |
// URLFetcher ID, only used for tests: we only have one kind of fetcher. |
@@ -207,8 +210,11 @@ std::string ContextualSearchDelegate::BuildRequestUrl(std::string selection) { |
TemplateURLRef::SearchTermsArgs search_terms_args = |
TemplateURLRef::SearchTermsArgs(base::string16()); |
+ int now_on_tap_version = |
+ field_trial_->IsNowOnTapBarIntegrationEnabled() ? kNowOnTapVersion : 0; |
+ |
TemplateURLRef::SearchTermsArgs::ContextualSearchParams params( |
- kContextualSearchRequestVersion, selected_text, "", true); |
+ kContextualSearchRequestVersion, selected_text, "", now_on_tap_version); |
Peter Kasting
2016/09/15 23:05:41
Nit: While here: "" -> std::string()
Donn Denman
2016/09/15 23:34:25
Done.
|
search_terms_args.contextual_search_params = params; |