| Index: chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| index 1bba62fbbb34805183bb0c138640a1b462ac5e32..1c2410922f1197f0242524199f9a53c5a6c00ac7 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| @@ -28,13 +28,11 @@ import android.text.TextUtils;
|
| import android.util.Base64;
|
|
|
| import org.chromium.base.ApiCompatibilityUtils;
|
| -import org.chromium.base.CommandLine;
|
| import org.chromium.base.ContextUtils;
|
| import org.chromium.base.Log;
|
| import org.chromium.base.ThreadUtils;
|
| import org.chromium.base.VisibleForTesting;
|
| import org.chromium.base.annotations.CalledByNative;
|
| -import org.chromium.blink_public.platform.WebDisplayMode;
|
| import org.chromium.chrome.R;
|
| import org.chromium.chrome.browser.webapps.WebApkBuilder;
|
| import org.chromium.chrome.browser.webapps.WebappAuthenticator;
|
| @@ -140,26 +138,24 @@ public class ShortcutHelper {
|
| */
|
| @SuppressWarnings("unused")
|
| @CalledByNative
|
| - private static void addShortcut(String id, String url, final String userTitle, String name,
|
| - String shortName, String iconUrl, Bitmap icon, int displayMode, int orientation,
|
| - int source, long themeColor, long backgroundColor, String manifestUrl,
|
| + private static void addShortcut(String id, int shortcutType, String url, final String userTitle,
|
| + String name, String shortName, String iconUrl, Bitmap icon, int displayMode,
|
| + int orientation, int source, long themeColor, long backgroundColor, String manifestUrl,
|
| final long callbackPointer) {
|
| assert !ThreadUtils.runningOnUiThread();
|
|
|
| Context context = ContextUtils.getApplicationContext();
|
| final Intent shortcutIntent;
|
| - boolean isWebappCapable = (displayMode == WebDisplayMode.Standalone
|
| - || displayMode == WebDisplayMode.Fullscreen);
|
| - if (isWebappCapable) {
|
| - if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_WEBAPK)) {
|
| - WebApkBuilder apkBuilder = ((ChromeApplication) context).createWebApkBuilder();
|
| - if (apkBuilder != null) {
|
| - apkBuilder.buildWebApkAsync(url, GURLUtils.getOrigin(url), name, shortName,
|
| - iconUrl, icon, displayMode, orientation, themeColor, backgroundColor,
|
| - manifestUrl);
|
| - return;
|
| - }
|
| + if (shortcutType == ShortcutType.WEBAPK) {
|
| + WebApkBuilder apkBuilder = ((ChromeApplication) context).createWebApkBuilder();
|
| + if (apkBuilder != null) {
|
| + apkBuilder.buildWebApkAsync(url, GURLUtils.getOrigin(url), name, shortName,
|
| + iconUrl, icon, displayMode, orientation, themeColor, backgroundColor,
|
| + manifestUrl);
|
| + return;
|
| }
|
| + }
|
| + if (shortcutType == ShortcutType.WEBAPP) {
|
| shortcutIntent = createWebappShortcutIntent(id, sDelegate.getFullscreenAction(), url,
|
| getScopeFromUrl(url), name, shortName, icon, WEBAPP_SHORTCUT_VERSION,
|
| displayMode, orientation, themeColor, backgroundColor, iconUrl.isEmpty());
|
| @@ -176,7 +172,7 @@ public class ShortcutHelper {
|
| sDelegate.sendBroadcast(
|
| context, createAddToHomeIntent(url, userTitle, icon, shortcutIntent));
|
|
|
| - if (isWebappCapable) {
|
| + if (shortcutType == ShortcutType.WEBAPP) {
|
| // Store the webapp data so that it is accessible without the intent. Once this process
|
| // is complete, call back to native code to start the splash image download.
|
| WebappRegistry.registerWebapp(context, id,
|
|
|