| 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 1b5ccd403adafc026f05b69d0d2c0744ab96f67a..833a0a5609098f7437f660684fa6209694f244d7 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| @@ -33,8 +33,12 @@ public class ShortcutHelper {
|
| public static final String EXTRA_TITLE = "org.chromium.chrome.browser.webapp_title";
|
| 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_THEME_COLOR = "org.chromium.chrome.browser.theme_color";
|
| public static final String EXTRA_SOURCE = "org.chromium.chrome.browser.webapp_source";
|
|
|
| + // This value is equal to kInvalidOrMissingThemeColor in the C++ content::Manifest struct.
|
| + public static final long THEME_COLOR_INVALID_OR_MISSING = -1;
|
| +
|
| // This value is equal to SOURCE_UNKNOWN in the C++ ShortcutInfo struct.
|
| public static final int SOURCE_UNKNOWN = 0;
|
|
|
| @@ -47,6 +51,7 @@ public class ShortcutHelper {
|
| void onIconAvailable(Bitmap icon);
|
| }
|
|
|
| + /** Delegate utilized for testing purposes */
|
| public static class Delegate {
|
| /**
|
| * Broadcasts an intent to all interested BroadcastReceivers.
|
| @@ -154,7 +159,7 @@ public class ShortcutHelper {
|
| @SuppressWarnings("unused")
|
| @CalledByNative
|
| private static void addShortcut(Context context, String url, String title, Bitmap icon,
|
| - boolean isWebappCapable, int orientation, int source) {
|
| + boolean isWebappCapable, long themeColor, int orientation, int source) {
|
| Intent shortcutIntent;
|
| if (isWebappCapable) {
|
| // Encode the icon as a base64 string (Launcher drops Bitmaps in the Intent).
|
| @@ -175,6 +180,7 @@ public class ShortcutHelper {
|
| shortcutIntent.putExtra(EXTRA_URL, url);
|
| shortcutIntent.putExtra(EXTRA_ORIENTATION, orientation);
|
| shortcutIntent.putExtra(EXTRA_MAC, getEncodedMac(context, url));
|
| + shortcutIntent.putExtra(EXTRA_THEME_COLOR, themeColor);
|
| } else {
|
| // Add the shortcut as a launcher icon to open in the browser Activity.
|
| shortcutIntent = BookmarkUtils.createShortcutIntent(url);
|
|
|