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

Unified Diff: chrome/browser/android/mojo/chrome_interface_registrar_android.cc

Issue 2374213002: Revert of Move registration of Java mojo interfaces to the new InterfaceRegistrar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@java-content-interface-registry
Patch Set: Created 4 years, 3 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/mojo/chrome_interface_registrar_android.cc
diff --git a/chrome/browser/android/mojo/chrome_interface_registrar_android.cc b/chrome/browser/android/mojo/chrome_interface_registrar_android.cc
index 78d502067e872f0092dc80e8afea183a2afdb589..f0cc1dcc1b913df128df9d0360da487952359bfc 100644
--- a/chrome/browser/android/mojo/chrome_interface_registrar_android.cc
+++ b/chrome/browser/android/mojo/chrome_interface_registrar_android.cc
@@ -4,13 +4,26 @@
#include "chrome/browser/android/mojo/chrome_interface_registrar_android.h"
-#include <jni.h>
-
#include "base/android/context_utils.h"
#include "base/android/jni_android.h"
+#include "content/public/browser/android/interface_registry_android.h"
+#include "content/public/browser/web_contents.h"
#include "jni/ChromeInterfaceRegistrar_jni.h"
+#include "services/shell/public/cpp/interface_registry.h"
-void RegisterChromeJavaMojoInterfaces() {
- Java_ChromeInterfaceRegistrar_registerMojoInterfaces(
- base::android::AttachCurrentThread());
+// static
+void ChromeInterfaceRegistrarAndroid::ExposeInterfacesToFrame(
+ shell::InterfaceRegistry* registry,
+ content::RenderFrameHost* render_frame_host) {
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(render_frame_host);
+
+ // Happens when, for example, showing the malware interstitial page.
+ if (!web_contents)
+ return;
+
+ Java_ChromeInterfaceRegistrar_exposeInterfacesToFrame(
+ base::android::AttachCurrentThread(),
+ content::InterfaceRegistryAndroid::Create(registry)->GetObj(),
+ web_contents->GetJavaWebContents());
}
« no previous file with comments | « chrome/browser/android/mojo/chrome_interface_registrar_android.h ('k') | chrome/browser/chrome_browser_main_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698