| 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 a9d7f8f9d8cd64e7457dd7b6371028a611217c61..205c3e26b0c7b74e325ae9658a0f6a748485216c 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
|
| @@ -11,8 +11,10 @@ import org.chromium.base.annotations.JNINamespace;
|
| import org.chromium.content.browser.ServiceRegistry.ImplementationFactory;
|
| import org.chromium.device.battery.BatteryMonitorFactory;
|
| import org.chromium.device.vibration.VibrationManagerImpl;
|
| +import org.chromium.device.sensors.SensorFactoryImpl;
|
| import org.chromium.mojom.device.BatteryMonitor;
|
| import org.chromium.mojom.device.VibrationManager;
|
| +import org.chromium.mojom.device.sensors.SensorFactory;
|
|
|
| /**
|
| * Registers mojo services exposed by the browser in the given registry.
|
| @@ -49,6 +51,20 @@ class ServiceRegistrar {
|
| }
|
| }
|
|
|
| + private static class SensorsImplementationFactory
|
| + implements ImplementationFactory<SensorFactory> {
|
| + private final Context mApplicationContext;
|
| +
|
| + SensorsImplementationFactory(Context applicationContext) {
|
| + mApplicationContext = applicationContext;
|
| + }
|
| +
|
| + @Override
|
| + public SensorFactory createImpl() {
|
| + return new SensorFactoryImpl(mApplicationContext);
|
| + }
|
| + }
|
| +
|
| @CalledByNative
|
| static void registerProcessHostServices(ServiceRegistry registry, Context applicationContext) {
|
| assert applicationContext != null;
|
| @@ -61,6 +77,8 @@ class ServiceRegistrar {
|
| assert applicationContext != null;
|
| registry.addService(VibrationManager.MANAGER,
|
| new VibrationManagerImplementationFactory(applicationContext));
|
| + registry.addService(SensorFactory.MANAGER,
|
| + new SensorsImplementationFactory(applicationContext));
|
| // TODO(avayvod): Register the PresentationService implementation here.
|
| }
|
| }
|
|
|