| 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 7dd850c688043e25b2db4080bcef64c375a9ebf5..191d34935b21058da2b6a1c55194123a8bbdced6 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| @@ -30,7 +30,10 @@ public class ShortcutHelper {
|
| public static final String EXTRA_ICON = "org.chromium.chrome.browser.webapp_icon";
|
| public static final String EXTRA_ID = "org.chromium.chrome.browser.webapp_id";
|
| public static final String EXTRA_MAC = "org.chromium.chrome.browser.webapp_mac";
|
| + // EXTRA_TITLE is present for backward compatibility reasons
|
| public static final String EXTRA_TITLE = "org.chromium.chrome.browser.webapp_title";
|
| + public static final String EXTRA_NAME = "org.chromium.chrome.browser.webapp_name";
|
| + public static final String EXTRA_SHORT_NAME = "org.chromium.chrome.browser.webapp_short_name";
|
| public static final String EXTRA_URL = "org.chromium.chrome.browser.webapp_url";
|
| public static final String EXTRA_ORIENTATION = ScreenOrientationConstants.EXTRA_ORIENTATION;
|
| public static final String EXTRA_SOURCE = "org.chromium.chrome.browser.webapp_source";
|
| @@ -38,7 +41,7 @@ public class ShortcutHelper {
|
| /** Observes the data fetching pipeline. */
|
| public interface ShortcutHelperObserver {
|
| /** Called when the title of the page is available. */
|
| - void onTitleAvailable(String title);
|
| + void onUserTitleAvailable(String title);
|
|
|
| /** Called when the icon to use in the launcher is available. */
|
| void onIconAvailable(Bitmap icon);
|
| @@ -114,8 +117,8 @@ public class ShortcutHelper {
|
| }
|
|
|
| @CalledByNative
|
| - private void onTitleAvailable(String title) {
|
| - mObserver.onTitleAvailable(title);
|
| + private void onUserTitleAvailable(String title) {
|
| + mObserver.onUserTitleAvailable(title);
|
| }
|
|
|
| @CalledByNative
|
| @@ -150,8 +153,8 @@ public class ShortcutHelper {
|
| */
|
| @SuppressWarnings("unused")
|
| @CalledByNative
|
| - private static void addShortcut(Context context, String url, String title, Bitmap icon,
|
| - boolean isWebappCapable, int orientation, int source) {
|
| + private static void addShortcut(Context context, String url, String userTitle, String name,
|
| + String shortName, Bitmap icon, boolean isWebappCapable, int orientation, int source) {
|
| Intent shortcutIntent;
|
| if (isWebappCapable) {
|
| // Encode the icon as a base64 string (Launcher drops Bitmaps in the Intent).
|
| @@ -168,7 +171,8 @@ public class ShortcutHelper {
|
| shortcutIntent.setAction(sDelegate.getFullscreenAction());
|
| shortcutIntent.putExtra(EXTRA_ICON, encodedIcon);
|
| shortcutIntent.putExtra(EXTRA_ID, UUID.randomUUID().toString());
|
| - shortcutIntent.putExtra(EXTRA_TITLE, title);
|
| + shortcutIntent.putExtra(EXTRA_NAME, name);
|
| + shortcutIntent.putExtra(EXTRA_SHORT_NAME, shortName);
|
| shortcutIntent.putExtra(EXTRA_URL, url);
|
| shortcutIntent.putExtra(EXTRA_ORIENTATION, orientation);
|
| shortcutIntent.putExtra(EXTRA_MAC, getEncodedMac(context, url));
|
| @@ -182,7 +186,7 @@ public class ShortcutHelper {
|
| shortcutIntent.putExtra(EXTRA_SOURCE, source);
|
| shortcutIntent.setPackage(context.getPackageName());
|
| sDelegate.sendBroadcast(
|
| - context, BookmarkUtils.createAddToHomeIntent(shortcutIntent, title, icon, url));
|
| + context, BookmarkUtils.createAddToHomeIntent(shortcutIntent, userTitle, icon, url));
|
|
|
| // Alert the user about adding the shortcut.
|
| final String shortUrl = UrlUtilities.getDomainAndRegistry(url, true);
|
|
|