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

Unified Diff: web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java

Issue 1888773004: 🙅 Bind a WebAPK to its "host" browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « web_apks/minting_example/src/org/chromium/minting/MintingApplication.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
diff --git a/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java b/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
index 3bd06219f7d6ffa85b0acd2bee8c638999ef2451..e7820da396c9e461f4ebdd3b6efde33a6c8c9d80 100644
--- a/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
+++ b/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
@@ -10,6 +10,8 @@ import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
+import org.chromium.minting.lib.common.WebAPKUtils;
+
import java.io.File;
import java.lang.reflect.Constructor;
@@ -36,11 +38,7 @@ public class MintingServiceFactory extends Service {
@Override
public IBinder onBind(Intent intent) {
if (sClassLoader == null) {
- String remotePackageName =
- getSharedPreferences(MintingApplication.MINT_PREFS, MODE_PRIVATE)
- .getString(MintingApplication.HOST_PACKAGE_PREF,
- MintingApplication.DEFAULT_CHROME_PACKAGE_NAME);
- Context remoteContext = DexLoader.getRemoteContext(this, remotePackageName);
+ Context remoteContext = WebAPKUtils.getHostBrowserContext(this);
if (remoteContext == null) {
Log.w(TAG, "Failed to get remote context.");
return null;
@@ -60,7 +58,7 @@ public class MintingServiceFactory extends Service {
try {
Class<?> mintedServiceImplClass =
sClassLoader.loadClass(MINTED_SERVICE_IMPL_CLASS_NAME);
- Constructor mintedServiceImplConstructor =
+ Constructor<?> mintedServiceImplConstructor =
mintedServiceImplClass.getConstructor(Context.class, int.class);
return (IBinder) mintedServiceImplConstructor.newInstance(new Object[] {this,
R.drawable.app_icon});
« no previous file with comments | « web_apks/minting_example/src/org/chromium/minting/MintingApplication.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698