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

Unified Diff: chrome/browser/android/contextualsearch/contextual_search_manager.cc

Issue 2706333002: [TTS] Add a Java Context linked to existing native (Closed)
Patch Set: Nothing, I think. Created 3 years, 9 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/android/contextualsearch/contextual_search_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/contextualsearch/contextual_search_manager.cc
diff --git a/chrome/browser/android/contextualsearch/contextual_search_manager.cc b/chrome/browser/android/contextualsearch/contextual_search_manager.cc
index 9c96f5ec1b866b8069559ad492730093f9027b0d..6eee9e4b90004c3c0fab1f9af9ccdc45e8ea6245 100644
--- a/chrome/browser/android/contextualsearch/contextual_search_manager.cc
+++ b/chrome/browser/android/contextualsearch/contextual_search_manager.cc
@@ -65,40 +65,32 @@ void ContextualSearchManager::Destroy(JNIEnv* env,
void ContextualSearchManager::StartSearchTermResolutionRequest(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
- const JavaParamRef<jstring>& j_selection,
- const JavaParamRef<jstring>& j_home_country,
- const JavaParamRef<jobject>& j_base_web_contents,
- jboolean j_may_send_base_page_url) {
+ const base::android::JavaParamRef<jobject>& j_contextual_search_context,
+ const JavaParamRef<jobject>& j_base_web_contents) {
WebContents* base_web_contents =
WebContents::FromJavaWebContents(j_base_web_contents);
DCHECK(base_web_contents);
- std::string selection(
- base::android::ConvertJavaStringToUTF8(env, j_selection));
- std::string home_country(
- base::android::ConvertJavaStringToUTF8(env, j_home_country));
- bool may_send_base_page_url = j_may_send_base_page_url;
+ ContextualSearchContext* contextual_search_context =
+ ContextualSearchContext::FromJavaContextualSearchContext(
+ j_contextual_search_context);
// Calls back to OnSearchTermResolutionResponse.
- delegate_->StartSearchTermResolutionRequest(
- selection, home_country, base_web_contents, may_send_base_page_url);
+ delegate_->StartSearchTermResolutionRequest(contextual_search_context,
+ base_web_contents);
}
void ContextualSearchManager::GatherSurroundingText(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
- const JavaParamRef<jstring>& j_selection,
- const JavaParamRef<jstring>& j_home_country,
- const JavaParamRef<jobject>& j_base_web_contents,
- jboolean j_may_send_base_page_url) {
+ const base::android::JavaParamRef<jobject>& j_contextual_search_context,
+ const JavaParamRef<jobject>& j_base_web_contents) {
WebContents* base_web_contents =
WebContents::FromJavaWebContents(j_base_web_contents);
DCHECK(base_web_contents);
- std::string selection(
- base::android::ConvertJavaStringToUTF8(env, j_selection));
- std::string home_country(
- base::android::ConvertJavaStringToUTF8(env, j_home_country));
- bool may_send_base_page_url = j_may_send_base_page_url;
- delegate_->GatherAndSaveSurroundingText(
- selection, home_country, base_web_contents, may_send_base_page_url);
+ ContextualSearchContext* contextual_search_context =
+ ContextualSearchContext::FromJavaContextualSearchContext(
+ j_contextual_search_context);
+ delegate_->GatherAndSaveSurroundingText(contextual_search_context,
+ base_web_contents);
}
base::android::ScopedJavaLocalRef<jstring>
« no previous file with comments | « chrome/browser/android/contextualsearch/contextual_search_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698