| 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();
|
| }
|
| }
|
|
|