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

Unified Diff: shell/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.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
Index: shell/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java b/shell/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
index 00cb241ce9742c8c7c1d39d074ff25d313baab0d..64979cb0c20c69dc81bc09fcce18948e85136acb 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java
@@ -5,22 +5,13 @@
package org.chromium.mojo.shell;
import android.app.Activity;
-import android.content.Context;
import android.content.Intent;
-import android.content.ServiceConnection;
-import android.net.Uri;
import android.os.Bundle;
-import java.util.ArrayDeque;
-
/**
* Entry point for the Mojo Shell application.
*/
-public class MojoShellActivity extends Activity implements ShellService.IShellBindingActivity {
- private ArrayDeque<Intent> mPendingIntents = new ArrayDeque<Intent>();
- private ShellService mShellService;
- private ServiceConnection mShellServiceConnection;
-
+public class MojoShellActivity extends Activity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -28,46 +19,11 @@ public class MojoShellActivity extends Activity implements ShellService.IShellBi
Intent serviceIntent = new Intent(this, ShellService.class);
// Copy potential startup arguments.
serviceIntent.putExtras(getIntent());
- startService(serviceIntent);
-
- mShellServiceConnection = new ShellService.ShellServiceConnection(this);
- bindService(serviceIntent, mShellServiceConnection, Context.BIND_AUTO_CREATE);
-
- onNewIntent(getIntent());
- }
-
- @Override
- protected void onNewIntent(Intent intent) {
- super.onNewIntent(intent);
- setIntent(intent);
- mPendingIntents.add(intent);
- }
-
- @Override
- public void onShellBound(ShellService shellService) {
- mShellService = shellService;
- finishAndRemoveTask();
- communicateWithShell();
- unbindService(mShellServiceConnection);
- }
-
- @Override
- public void onShellUnbound() {
- mShellService = null;
- mShellServiceConnection = null;
- }
-
- /**
- * Communicate with the shell to start new apps, based on pending intents.
- */
- private void communicateWithShell() {
- while (!mPendingIntents.isEmpty()) {
- Intent intent = mPendingIntents.remove();
- Uri data = intent.getData();
- if (data != null) {
- String url = data.buildUpon().scheme("https").build().toString();
- mShellService.startApplicationURL(url);
- }
+ if (getIntent().getData() != null) {
+ serviceIntent.putExtra(
+ ShellService.APPLICATION_URL_EXTRA, getIntent().getData().toString());
}
+ startService(serviceIntent);
+ finish();
}
}
« no previous file with comments | « shell/android/apk/AndroidManifest.xml.jinja2 ('k') | shell/android/apk/src/org/chromium/mojo/shell/ShellService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698