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

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

Issue 1385663002: [Contextual Search] Add Mojo-enabled API component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed the CS API controller to not be a notification observer. Created 5 years, 2 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698