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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java

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: Make InvalidMessageException static. Created 4 years, 8 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/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java b/content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java
index e8c279eba71fe6d02ad850868bec051be71ac3e7..51a9992e748e9ec48c321ee2f16c34b94c6fa6f1 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java
@@ -10,8 +10,10 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.content.browser.ServiceRegistry.ImplementationFactory;
import org.chromium.device.battery.BatteryMonitorFactory;
+import org.chromium.device.nfc.NfcImpl;
import org.chromium.device.vibration.VibrationManagerImpl;
import org.chromium.mojom.device.BatteryMonitor;
+import org.chromium.mojom.device.Nfc;
import org.chromium.mojom.device.VibrationManager;
/**
@@ -35,6 +37,19 @@ class ServiceRegistrar {
}
}
+ private static class NfcImplementationFactory implements ImplementationFactory<Nfc> {
+ private final Context mApplicationContext;
+
+ NfcImplementationFactory(Context applicationContext) {
+ mApplicationContext = applicationContext;
+ }
+
+ @Override
+ public Nfc createImpl() {
+ return new NfcImpl(mApplicationContext);
+ }
+ }
+
private static class VibrationManagerImplementationFactory
implements ImplementationFactory<VibrationManager> {
private final Context mApplicationContext;
@@ -62,5 +77,6 @@ class ServiceRegistrar {
static void registerFrameHostServices(ServiceRegistry registry, Context applicationContext) {
assert applicationContext != null;
// TODO(avayvod): Register the PresentationService implementation here.
+ registry.addService(Nfc.MANAGER, new NfcImplementationFactory(applicationContext));
}
}

Powered by Google App Engine
This is Rietveld 408576698