| 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 c8b41abd68a97fa200bc5a5110e76b3159d05e6f..4f2fdffb38ec608fc0a8fd398b25d1fe9a1e826a 100644
|
| --- a/chrome/browser/android/contextualsearch/contextual_search_manager.cc
|
| +++ b/chrome/browser/android/contextualsearch/contextual_search_manager.cc
|
| @@ -13,11 +13,13 @@
|
| #include "chrome/browser/android/contextualsearch/contextual_search_delegate.h"
|
| #include "chrome/browser/android/tab_android.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| +#include "chrome/browser/search/contextual_search_service.h"
|
| #include "chrome/browser/search_engines/template_url_service_factory.h"
|
| #include "chrome/browser/ui/android/window_android_helper.h"
|
| #include "components/navigation_interception/intercept_navigation_delegate.h"
|
| #include "components/variations/variations_associated_data.h"
|
| #include "content/public/browser/android/content_view_core.h"
|
| +#include "content/public/browser/render_process_host.h"
|
| #include "jni/ContextualSearchManager_jni.h"
|
| #include "net/url_request/url_fetcher_impl.h"
|
|
|
| @@ -138,6 +140,21 @@ void ContextualSearchManager::OnIcingSelectionAvailable(
|
| start_offset, end_offset);
|
| }
|
|
|
| +void ContextualSearchManager::EnableContextualSearchServiceForView(
|
| + JNIEnv* env,
|
| + jobject obj,
|
| + jobject j_overlay_content_view_core) {
|
| + ContentViewCore* overlay_content_view_core =
|
| + ContentViewCore::GetNativeContentViewCore(env,
|
| + j_overlay_content_view_core);
|
| + if (overlay_content_view_core != NULL) {
|
| + ContextualSearchService::GetInstance()->SetContextualSearchProcess(
|
| + overlay_content_view_core->GetWebContents()
|
| + ->GetRenderProcessHost()
|
| + ->GetID());
|
| + }
|
| +}
|
| +
|
| bool RegisterContextualSearchManager(JNIEnv* env) {
|
| return RegisterNativesImpl(env);
|
| }
|
|
|