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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java

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 and make contextual search /search requests accessible from Java. 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/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java b/chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java
index 05365588a47f9ccba248a6091d7e8f6c31665b40..1ae1c2d98dbe18f530b4fe29b1cc5c1ccfd9a24f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java
@@ -223,6 +223,16 @@ public class TemplateUrlService {
return nativeReplaceSearchTermsInUrl(mNativeTemplateUrlServiceAndroid, query, url);
}
+ /**
+ * Finds the default search engine for the default provider and returns the url query
+ * {@link String} for {@code query} with the contextual search version param set.
+ * @return A {@link String} that contains the url of the default search engine with
+ * {@code query} inserted as the search parameter and contextual search param set.
+ */
+ public String getUrlForContextualSearchQuery(String query) {
+ return nativeGetUrlForContextualSearchQuery(mNativeTemplateUrlServiceAndroid, query);
+ }
+
private native long nativeInit();
private native void nativeLoad(long nativeTemplateUrlServiceAndroid);
private native boolean nativeIsLoaded(long nativeTemplateUrlServiceAndroid);

Powered by Google App Engine
This is Rietveld 408576698