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

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

Issue 1274033002: Vibration API: convert implementation to java mojo-service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/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 451ab4f6d28a813bc5b4ea6b8c1101dde5cb79fa..e8c279eba71fe6d02ad850868bec051be71ac3e7 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,7 +10,9 @@ 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.vibration.VibrationManagerImpl;
import org.chromium.mojom.device.BatteryMonitor;
+import org.chromium.mojom.device.VibrationManager;
/**
* Registers mojo services exposed by the browser in the given registry.
@@ -33,11 +35,27 @@ class ServiceRegistrar {
}
}
+ private static class VibrationManagerImplementationFactory
+ implements ImplementationFactory<VibrationManager> {
+ private final Context mApplicationContext;
+
+ VibrationManagerImplementationFactory(Context applicationContext) {
+ mApplicationContext = applicationContext;
+ }
+
+ @Override
+ public VibrationManager createImpl() {
+ return new VibrationManagerImpl(mApplicationContext);
+ }
+ }
+
@CalledByNative
static void registerProcessHostServices(ServiceRegistry registry, Context applicationContext) {
assert applicationContext != null;
registry.addService(BatteryMonitor.MANAGER,
new BatteryMonitorImplementationFactory(applicationContext));
+ registry.addService(VibrationManager.MANAGER,
+ new VibrationManagerImplementationFactory(applicationContext));
}
@CalledByNative

Powered by Google App Engine
This is Rietveld 408576698