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

Unified Diff: components/installedapp/android/java/src/org/chromium/device/installedapp/InstalledAppProviderFactory.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
Index: components/installedapp/android/java/src/org/chromium/device/installedapp/InstalledAppProviderFactory.java
diff --git a/components/installedapp/android/java/src/org/chromium/device/installedapp/InstalledAppProviderFactory.java b/components/installedapp/android/java/src/org/chromium/device/installedapp/InstalledAppProviderFactory.java
new file mode 100644
index 0000000000000000000000000000000000000000..0a60adc6a18a2e91fb7d2d7bf2a4e52fbf4b1941
--- /dev/null
+++ b/components/installedapp/android/java/src/org/chromium/device/installedapp/InstalledAppProviderFactory.java
@@ -0,0 +1,37 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.components.installedapp;
+
+import android.content.Context;
+
+import org.chromium.base.ThreadUtils;
+import org.chromium.components.installedapp.InstalledAppProviderImpl;
+import org.chromium.mojom.components.InstalledAppProvider;
+
+/**
+ * Serves as a factory for InstalledAppProvider implementation as well as the global (as in the
+ * browser process) implementation of the Presentation API on Android.
+ */
+public final class InstalledAppProviderFactory {
+ public static InstalledAppProviderFactory sInstance;
+ private static Context mContext;
+
+ public static InstalledAppProviderFactory instance(Context applicationContext) {
+ ThreadUtils.assertOnUiThread();
+
+ // Need to hold onto this context!
+ if (sInstance == null) sInstance = new InstalledAppProviderFactory(applicationContext);
+
+ return sInstance;
+ }
+
+ public InstalledAppProvider createInstalledAppProvider() {
+ return new InstalledAppProviderImpl(mContext);
+ }
+
+ private InstalledAppProviderFactory(Context applicationContext) {
+ mContext = applicationContext;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698