| Index: content/browser/mojo/interface_registrar_android.cc
|
| diff --git a/content/browser/mojo/interface_registrar_android.cc b/content/browser/mojo/interface_registrar_android.cc
|
| index cba21cf53c16e52f18301e35f6ce441d73896cf9..455014f732bc3a20026ca947f69068a4029ea4b4 100644
|
| --- a/content/browser/mojo/interface_registrar_android.cc
|
| +++ b/content/browser/mojo/interface_registrar_android.cc
|
| @@ -7,6 +7,7 @@
|
| #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/InterfaceRegistrar_jni.h"
|
|
|
| namespace content {
|
| @@ -21,9 +22,16 @@ void InterfaceRegistrarAndroid::ExposeInterfacesToRenderer(
|
|
|
| // static
|
| void InterfaceRegistrarAndroid::ExposeInterfacesToFrame(
|
| - InterfaceRegistryAndroid* registry) {
|
| + InterfaceRegistryAndroid* registry, RenderFrameHost* frame) {
|
| + base::android::ScopedJavaLocalRef<jobject> java_web_contents;
|
| + WebContents* contents = WebContents::FromRenderFrameHost(frame);
|
| + if (contents)
|
| + java_web_contents = contents->GetJavaWebContents();
|
| +
|
| JNIEnv* env = base::android::AttachCurrentThread();
|
| Java_InterfaceRegistrar_exposeInterfacesToFrame(
|
| - env, registry->GetObj().obj(), base::android::GetApplicationContext());
|
| + env, registry->GetObj().obj(),
|
| + base::android::GetApplicationContext(),
|
| + java_web_contents.obj());
|
| }
|
| } // namespace content
|
|
|