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

Unified Diff: content/browser/mojo/service_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: Avoid caching Activity. Created 4 years, 7 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/service_registrar_android.cc
diff --git a/content/browser/mojo/service_registrar_android.cc b/content/browser/mojo/service_registrar_android.cc
index cd0cfacf81883ef2dd4c35a3913e191778ecc203..0b0be9f76c970731ddcac26ed0c0c59fdceb6b74 100644
--- a/content/browser/mojo/service_registrar_android.cc
+++ b/content/browser/mojo/service_registrar_android.cc
@@ -7,6 +7,7 @@
#include "base/android/context_utils.h"
#include "base/android/jni_android.h"
#include "content/public/browser/android/service_registry_android.h"
+#include "content/public/browser/web_contents.h"
#include "jni/ServiceRegistrar_jni.h"
namespace content {
@@ -26,9 +27,16 @@ void ServiceRegistrarAndroid::RegisterProcessHostServices(
// static
void ServiceRegistrarAndroid::RegisterFrameHostServices(
- ServiceRegistryAndroid* registry) {
+ ServiceRegistryAndroid* registry, RenderFrameHost* frame) {
+ ScopedJavaLocalRef<jobject> java_web_contents;
+ WebContents* contents = WebContents::FromRenderFrameHost(frame);
+ if (contents)
+ java_web_contents = contents->GetJavaWebContents();
+
JNIEnv* env = base::android::AttachCurrentThread();
Java_ServiceRegistrar_registerFrameHostServices(
- 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