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

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

Issue 106103006: Added android Template URL support for voice search. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase! Created 7 years 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 | « no previous file | chrome/browser/search_engines/template_url_service_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f12c987e137beea0c2129a89153f31c03154162a..e0bc518e42a977f2f66fd39f8d7532596ce03069 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
@@ -200,6 +200,18 @@ public class TemplateUrlService {
}
/**
+ * Finds the default search engine for the default provider and returns the url query
+ * {@link String} for {@code query} with voice input source param set.
+ * @param query The {@link String} that represents the text query the search url should
+ * represent.
+ * @return A {@link String} that contains the url of the default search engine with
+ * {@code query} inserted as the search parameter and voice input source param set.
+ */
+ public String getUrlForVoiceSearchQuery(String query) {
+ return nativeGetUrlForVoiceSearchQuery(mNativeTemplateUrlServiceAndroid, query);
+ }
+
+ /**
* Replaces the search terms from {@code query} in {@code url}.
* @param query The {@link String} that represents the text query that should replace the
* existing query in {@code url}.
@@ -225,6 +237,8 @@ public class TemplateUrlService {
private native boolean nativeIsDefaultSearchEngineGoogle(long nativeTemplateUrlServiceAndroid);
private native String nativeGetUrlForSearchQuery(long nativeTemplateUrlServiceAndroid,
String query);
+ private native String nativeGetUrlForVoiceSearchQuery(long nativeTemplateUrlServiceAndroid,
+ String query);
private native String nativeReplaceSearchTermsInUrl(long nativeTemplateUrlServiceAndroid,
String query, String currentUrl);
}
« no previous file with comments | « no previous file | chrome/browser/search_engines/template_url_service_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698