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

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: Added more comments to mojom. 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
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

Powered by Google App Engine
This is Rietveld 408576698