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

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

Issue 601003002: Add a template url accessor for contextual search that doesn't preload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add back the accessor with the current signature for compatability. Created 6 years, 3 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/template_url_service_android.h ('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_service_android.cc
diff --git a/chrome/browser/search_engines/template_url_service_android.cc b/chrome/browser/search_engines/template_url_service_android.cc
index b2bd0c36530de0da59912ee339943dec3690a377..6230c71ac734fa8be5158c0362ebf178ebe3efe2 100644
--- a/chrome/browser/search_engines/template_url_service_android.cc
+++ b/chrome/browser/search_engines/template_url_service_android.cc
@@ -204,7 +204,8 @@ TemplateUrlServiceAndroid::GetUrlForContextualSearchQuery(
JNIEnv* env,
jobject obj,
jstring jquery,
- jstring jalternate_term) {
+ jstring jalternate_term,
+ jboolean jshould_prefetch) {
base::string16 query(base::android::ConvertJavaStringToUTF16(env, jquery));
std::string url;
@@ -212,8 +213,10 @@ TemplateUrlServiceAndroid::GetUrlForContextualSearchQuery(
GURL gurl(GetDefaultSearchURLForSearchTerms(template_url_service_, query));
if (google_util::IsGoogleSearchUrl(gurl)) {
gurl = net::AppendQueryParameter(gurl, "ctxs", "2");
- // Indicate that the search page is being prefetched.
- gurl = net::AppendQueryParameter(gurl, "pf", "c");
+ if (jshould_prefetch) {
+ // Indicate that the search page is being prefetched.
+ gurl = net::AppendQueryParameter(gurl, "pf", "c");
+ }
if (jalternate_term) {
std::string alternate_term(
« no previous file with comments | « chrome/browser/search_engines/template_url_service_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698