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

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

Issue 1126323003: WindowManager now can handle URL intents on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing presubmit errors Created 5 years, 7 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 | « mandoline/app/android/apk/AndroidManifest.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
diff --git a/mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java b/mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
index a56c43de651efc3659823a18418bb9024ad8061b..901012fbb217adecdb4368f37cbb26f0e3f22984 100644
--- a/mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
+++ b/mojo/runner/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
@@ -6,9 +6,11 @@ package org.chromium.mojo.shell;
import android.app.Activity;
import android.content.Intent;
+import android.net.Uri;
import android.os.Bundle;
import android.util.JsonReader;
-import android.util.Log;
+
+import org.chromium.base.Log;
import java.io.IOException;
import java.io.StringReader;
@@ -25,6 +27,22 @@ public class MojoShellActivity extends Activity {
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ String[] parameters = getParametersFromIntent(getIntent());
+ if (Intent.ACTION_VIEW.equals(getIntent().getAction())) {
+ Uri uri = getIntent().getData();
+ if (uri != null) {
+ Log.i(TAG, "MojoShellActivity opening " + uri);
+ if (parameters == null) {
+ parameters = new String[] {uri.toString()};
+ } else {
+ String[] newParameters = new String[parameters.length + 1];
+ System.arraycopy(parameters, 0, newParameters, 0, parameters.length);
+ newParameters[parameters.length] = uri.toString();
+ parameters = newParameters;
+ }
+ }
+ }
+
// TODO(ppi): Gotcha - the call below will work only once per process lifetime, but the OS
// has no obligation to kill the application process between destroying and restarting the
// activity. If the application process is kept alive, initialization parameters sent with
@@ -32,7 +50,7 @@ public class MojoShellActivity extends Activity {
// TODO(qsr): We should be passing application context here as required by
// InitApplicationContext on the native side. Currently we can't, as PlatformViewportAndroid
// relies on this being the activity context.
- ShellMain.ensureInitialized(this, getParametersFromIntent(getIntent()));
+ ShellMain.ensureInitialized(this, parameters);
// TODO(eseidel): ShellMain can fail, but we're ignoring the return.
ShellMain.start();
« no previous file with comments | « mandoline/app/android/apk/AndroidManifest.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698