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

Unified Diff: content/browser/mojo/interface_registrar_android.cc

Issue 1486043002: [webnfc] Implement push method for Android nfc mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@step_6_add_mojo_service_CL
Patch Set: Move WindowAndroidChangedObserver to other observers in content layer Created 4 years, 4 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
« no previous file with comments | « content/browser/mojo/interface_registrar_android.h ('k') | content/content.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5d1608747c32d6e896acc36248bf98c3335029a6..49070f9a7701e7b215c79e6bbd7892ec4f9636a5 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(), base::android::GetApplicationContext());
+ env, registry->GetObj(),
+ base::android::GetApplicationContext(),
+ java_web_contents);
}
} // namespace content
« no previous file with comments | « content/browser/mojo/interface_registrar_android.h ('k') | content/content.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698