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

Unified Diff: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java

Issue 2094113002: Pass ShortcutHelper.EXTRA_SOURCE when WebAPK is launched from notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'webapk_more_meta' into webapk_more_meta2 Created 4 years, 6 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/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java
diff --git a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NavigationClient.java b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java
similarity index 65%
rename from chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NavigationClient.java
rename to chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java
index 734bbe172c1432ca14b1d4501f8b380c373d330f..39e5fdb79b3d25d85759c0c8b8a299878e1ce6e8 100644
--- a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NavigationClient.java
+++ b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java
@@ -4,29 +4,28 @@
package org.chromium.webapk.lib.client;
-import android.content.Context;
import android.content.Intent;
/**
- * NavigationClient provides an API to launch a WebAPK.
+ * WebApkNavigationClient provides an API to get an intent to launch a WebAPK.
*/
-public class NavigationClient {
+public class WebApkNavigationClient {
/**
- * Launches a WebAPK.
- * @param context Application context.
+ * Creates intent to launch a WebAPK.
* @param webApkPackageName Package name of the WebAPK to launch.
* @param url URL to navigate WebAPK to.
+ * @return The intent.
*/
- public static void launchWebApk(Context context, String webApkPackageName, String url) {
+ public static Intent createLaunchWebApkIntent(String webApkPackageName, String url) {
Intent intent;
try {
intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
} catch (Exception e) {
- return;
+ return null;
}
intent.setPackage(webApkPackageName);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- context.startActivity(intent);
+ return intent;
}
}

Powered by Google App Engine
This is Rietveld 408576698