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

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

Issue 1586563009: IsNativeAppInstalled Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « content/content_tests.gypi ('k') | content/renderer/installedapp/web_installed_app_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f481113c1ca5c707e787f1da054d0fb26205620b 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
@@ -9,6 +9,8 @@ import android.content.Context;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.content.browser.ServiceRegistry.ImplementationFactory;
+import org.chromium.components.installedapp.InstalledAppProviderFactory;
+import org.chromium.mojom.components.InstalledAppProvider;
import org.chromium.device.battery.BatteryMonitorFactory;
import org.chromium.device.vibration.VibrationManagerImpl;
import org.chromium.mojom.device.BatteryMonitor;
@@ -49,6 +51,20 @@ class ServiceRegistrar {
}
}
+ private static class InstalledAppProviderImplementationFactory
+ implements ImplementationFactory<InstalledAppProvider> {
+ private final InstalledAppProviderFactory mFactory;
+
+ InstalledAppProviderImplementationFactory(Context applicationContext) {
+ mFactory = InstalledAppProviderFactory.instance(applicationContext);
+ }
+
+ @Override
+ public InstalledAppProvider createImpl() {
+ return mFactory.createInstalledAppProvider();
+ }
+ }
+
@CalledByNative
static void registerProcessHostServices(ServiceRegistry registry, Context applicationContext) {
assert applicationContext != null;
@@ -56,6 +72,8 @@ class ServiceRegistrar {
new BatteryMonitorImplementationFactory(applicationContext));
registry.addService(VibrationManager.MANAGER,
new VibrationManagerImplementationFactory(applicationContext));
+ registry.addService(InstalledAppProvider.MANAGER,
+ new InstalledAppProviderImplementationFactory(applicationContext));
}
@CalledByNative
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/installedapp/web_installed_app_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698