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

Unified Diff: services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java

Issue 2865653002: [Device Service] Decouple NFC implementation from //content (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « services/device/BUILD.gn ('k') | services/device/device_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java
diff --git a/services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java b/services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java
index b9e230bb922259044f9a81661fcdcc6ebc259290..62347c5f9d00c99ad7bd4ad1521fac9afdbbbc13 100644
--- a/services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java
+++ b/services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java
@@ -11,6 +11,9 @@ import org.chromium.base.annotations.JNINamespace;
import org.chromium.device.battery.BatteryMonitorFactory;
import org.chromium.device.mojom.BatteryMonitor;
import org.chromium.device.mojom.VibrationManager;
+import org.chromium.device.nfc.NfcDelegate;
+import org.chromium.device.nfc.NfcProviderImpl;
+import org.chromium.device.nfc.mojom.NfcProvider;
import org.chromium.device.vibration.VibrationManagerImpl;
import org.chromium.mojo.system.impl.CoreImpl;
import org.chromium.services.service_manager.InterfaceRegistry;
@@ -18,13 +21,16 @@ import org.chromium.services.service_manager.InterfaceRegistry;
@JNINamespace("device")
class InterfaceRegistrar {
@CalledByNative
- static void createInterfaceRegistryForContext(int nativeHandle, Context applicationContext) {
+ static void createInterfaceRegistryForContext(
+ int nativeHandle, Context applicationContext, NfcDelegate nfcDelegate) {
// Note: The bindings code manages the lifetime of this object, so it
// is not necessary to hold on to a reference to it explicitly.
InterfaceRegistry registry = InterfaceRegistry.create(
CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
registry.addInterface(
BatteryMonitor.MANAGER, new BatteryMonitorFactory(applicationContext));
+ registry.addInterface(
+ NfcProvider.MANAGER, new NfcProviderImpl.Factory(applicationContext, nfcDelegate));
registry.addInterface(
VibrationManager.MANAGER, new VibrationManagerImpl.Factory(applicationContext));
}
« no previous file with comments | « services/device/BUILD.gn ('k') | services/device/device_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698