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 cca9297848252635aa9c07fbb3a4c559f6b8c9c4..b52e7510431d0769852fca33c44a7e952df08555 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java |
@@ -31,6 +31,8 @@ public class ShortcutHelper { |
public static final String EXTRA_ID = "org.chromium.chrome.browser.webapp_id"; |
public static final String EXTRA_MAC = "org.chromium.chrome.browser.webapp_mac"; |
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"; |
@@ -41,7 +43,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); |
@@ -99,8 +101,8 @@ public class ShortcutHelper { |
} |
@CalledByNative |
- private void onTitleAvailable(String title) { |
- mObserver.onTitleAvailable(title); |
+ private void onUserTitleAvailable(String title) { |
+ mObserver.onUserTitleAvailable(title); |
} |
@CalledByNative |
@@ -140,8 +142,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) { |
assert sFullScreenAction != null; |
Intent shortcutIntent; |
@@ -160,7 +162,8 @@ public class ShortcutHelper { |
shortcutIntent.setAction(sFullScreenAction); |
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)); |
@@ -174,7 +177,7 @@ public class ShortcutHelper { |
shortcutIntent.putExtra(EXTRA_SOURCE, source); |
shortcutIntent.setPackage(context.getPackageName()); |
context.sendBroadcast( |
- BookmarkUtils.createAddToHomeIntent(shortcutIntent, title, icon, url)); |
+ BookmarkUtils.createAddToHomeIntent(shortcutIntent, userTitle, icon, url)); |
// Alert the user about adding the shortcut. |
final String shortUrl = UrlUtilities.getDomainAndRegistry(url, true); |