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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java

Issue 1867543002: Enable deep-linking from notifications for recently used web apps on the Android home screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bulk-webappdatastorage
Patch Set: Address nits Created 4 years, 8 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: 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 0ab0d9dd95c5568afc62e2793e6e559c90b8e8bf..731704b0dcdf751e445e7ae2c8d0e8fba8c28702 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
@@ -14,6 +14,7 @@ import android.util.Base64;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.Log;
+import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.ShortcutHelper;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
import org.chromium.chrome.browser.metrics.LaunchMetrics;
@@ -58,7 +59,15 @@ public class WebappLauncherActivity extends Activity {
webappMacString == null ? null : Base64.decode(webappMacString, Base64.DEFAULT);
Intent launchIntent = null;
- if (webappMac != null && WebappAuthenticator.isUrlValid(this, webappUrl, webappMac)) {
+
+ // Permit the launch to a standalone web app frame if the intent was sent by Chrome, or
+ // if the MAC is present and valid for the URL to be opened.
+ boolean isTrusted = IntentHandler.wasIntentSenderChrome(intent,
+ ApplicationStatus.getApplicationContext());
+ boolean isUrlValid = (webappMac != null
+ && WebappAuthenticator.isUrlValid(this, webappUrl, webappMac));
+
+ if (isTrusted || isUrlValid) {
LaunchMetrics.recordHomeScreenLaunchIntoStandaloneActivity(webappUrl, webappSource);
String activityName = WebappActivity.class.getName();

Powered by Google App Engine
This is Rietveld 408576698