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

Unified Diff: shell/android/apk/src/org/chromium/mojo/shell/ShellService.java

Issue 1397443002: Make MojoShellActivity ephemeral. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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 | « shell/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/android/apk/src/org/chromium/mojo/shell/ShellService.java
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/ShellService.java b/shell/android/apk/src/org/chromium/mojo/shell/ShellService.java
index b3804c33e5ea1799ba79f4d02c3aab79b23fb656..efb129c7c898f3c9f5a9e15deb4ca8a75d6fa8e4 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/ShellService.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/ShellService.java
@@ -11,6 +11,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.res.AssetManager;
+import android.net.Uri;
import android.os.Binder;
import android.os.IBinder;
import android.util.JsonReader;
@@ -42,6 +43,9 @@ import java.util.List;
public class ShellService extends Service {
private static final String TAG = "ShellService";
+ // Name of the intent extra used to hold the application url to start.
+ public static final String APPLICATION_URL_EXTRA = "application_url";
+
// Directory where applications bundled with the shell will be extracted.
private static final String LOCAL_APP_DIRECTORY = "local_apps";
// Individual applications bundled with the shell as assets.
@@ -167,6 +171,12 @@ public class ShellService extends Service {
// only the first set of parameters will ever be taken into account.
// TODO(eseidel): ShellService can fail, but we're ignoring the return.
ensureStarted(getApplicationContext(), getParametersFromIntent(intent));
+ if (intent.hasExtra(APPLICATION_URL_EXTRA)) {
+ // This intent requests we start an application.
+ String urlExtra = intent.getStringExtra(APPLICATION_URL_EXTRA);
+ Uri applicationUri = Uri.parse(urlExtra).buildUpon().scheme("https").build();
+ startApplicationURL(applicationUri.toString());
+ }
return Service.START_STICKY;
}
« no previous file with comments | « shell/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698