Chromium Code Reviews| 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..2a83942156ebdce72c6a977dac9aecfe8d274a34 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_api_controller.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,29 @@ void ContextualSearchManager::OnIcingSelectionAvailable( |
| start_offset, end_offset); |
| } |
| +void ContextualSearchManager::AddViewForContextualSearchApi( |
| + 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) { |
| + ContextualSearchApiController::GetInstance()->AddContextualSearchProcess( |
|
pedro (no code reviews)
2015/10/23 05:43:54
Nit: What is being added is an ID, not a process,
Donn Denman
2015/10/23 18:58:07
Done.
|
| + overlay_content_view_core->GetWebContents() |
| + ->GetRenderProcessHost() |
| + ->GetID()); |
| + } |
| +} |
| + |
| +void ContextualSearchManager::RemoveViewForContextualSearchApi( |
| + JNIEnv* env, |
| + jobject obj, |
| + int render_process_host_id) { |
| + ContextualSearchApiController::GetInstance()->RemoveContextualSearchProcess( |
| + render_process_host_id); |
| +} |
| + |
| bool RegisterContextualSearchManager(JNIEnv* env) { |
| return RegisterNativesImpl(env); |
| } |