| Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
|
| index c25ccaebbc11b28233f726ba673aa941fe847384..0b7ed276effc4fbe17defa62b5994fb3f5d858ef 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
|
| @@ -17,6 +17,7 @@ import org.chromium.base.ContextUtils;
|
| import org.chromium.base.Log;
|
| import org.chromium.chrome.browser.IntentHandler;
|
| import org.chromium.chrome.browser.ShortcutHelper;
|
| +import org.chromium.chrome.browser.ShortcutSource;
|
| import org.chromium.chrome.browser.document.ChromeLauncherActivity;
|
| import org.chromium.chrome.browser.metrics.LaunchMetrics;
|
| import org.chromium.chrome.browser.tab.Tab;
|
| @@ -87,6 +88,17 @@ public class WebappLauncherActivity extends Activity {
|
| // Activity.
|
| launchIntent.setAction(Intent.ACTION_VIEW);
|
| launchIntent.setData(Uri.parse(WebappActivity.WEBAPP_SCHEME + "://" + webappId));
|
| +
|
| + // If this is launching from a notification, we want to ensure that the URL being
|
| + // launched is the URL in the intent. If a paused WebappActivity exists for this id,
|
| + // then by default it will be focused and we have no way of sending the desired URL
|
| + // to it (the intent is swallowed). As a workaround, set the CLEAR_TOP flag to
|
| + // ensure that the existing Activity is cleared and relaunched with this intent.
|
| + // TODO(dominickn): ideally, we want be able to route an intent to
|
| + // WebappActivity.onNewIntent instead of restarting the Activity.
|
| + if (webappSource == ShortcutSource.NOTIFICATION) {
|
| + launchIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
| + }
|
| } else {
|
| Log.e(TAG, "Shortcut (%s) opened in Chrome.", webappUrl);
|
|
|
|
|