| Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java
|
| index 260b2553732a1a91db1ca4cc4c094d69fd08f582..27c8397727ba95c5f81d9009f9c0c0692bd201d5 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java
|
| @@ -29,6 +29,7 @@ public class WebappInfo {
|
| private String mTitle;
|
| private int mOrientation;
|
| private int mSource;
|
| + private long mThemeColor;
|
|
|
| public static WebappInfo createEmpty() {
|
| return new WebappInfo();
|
| @@ -47,7 +48,9 @@ public class WebappInfo {
|
| ShortcutHelper.EXTRA_ORIENTATION, ScreenOrientationValues.DEFAULT);
|
| int source = intent.getIntExtra(
|
| ShortcutHelper.EXTRA_SOURCE, ShortcutHelper.SOURCE_UNKNOWN);
|
| - return create(id, url, icon, title, orientation, source);
|
| + long themeColor = intent.getLongExtra(ShortcutHelper.EXTRA_THEME_COLOR,
|
| + ShortcutHelper.THEME_COLOR_INVALID_OR_MISSING);
|
| + return create(id, url, icon, title, orientation, source, themeColor);
|
| }
|
|
|
| /**
|
| @@ -56,11 +59,12 @@ public class WebappInfo {
|
| * @param url URL for the webapp.
|
| * @param icon Icon to show for the webapp.
|
| * @param title Title of the webapp.
|
| + * @param themeColor The theme color of the webapp.
|
| * @param orientation Orientation of the webapp.
|
| * @param source Source where the webapp was added from.
|
| */
|
| public static WebappInfo create(String id, String url, String icon, String title,
|
| - int orientation, int source) {
|
| + int orientation, int source, long themeColor) {
|
| if (id == null || url == null) {
|
| Log.e("WebappInfo", "Data passed in was incomplete: " + id + ", " + url);
|
| return null;
|
| @@ -73,16 +77,18 @@ public class WebappInfo {
|
| }
|
|
|
| Uri uri = Uri.parse(url);
|
| - return new WebappInfo(id, uri, favicon, title, orientation, source);
|
| + return new WebappInfo(id, uri, favicon, title, orientation, source, themeColor);
|
| }
|
|
|
| - private WebappInfo(String id, Uri uri, Bitmap icon, String title, int orientation, int source) {
|
| + private WebappInfo(String id, Uri uri, Bitmap icon, String title,
|
| + int orientation, int source, long themeColor) {
|
| mIcon = icon;
|
| mId = id;
|
| mTitle = title;
|
| mUri = uri;
|
| mOrientation = orientation;
|
| mSource = source;
|
| + mThemeColor = themeColor;
|
| mIsInitialized = mUri != null;
|
| }
|
|
|
| @@ -102,6 +108,7 @@ public class WebappInfo {
|
| outState.putString(ShortcutHelper.EXTRA_TITLE, mTitle);
|
| outState.putInt(ShortcutHelper.EXTRA_ORIENTATION, mOrientation);
|
| outState.putInt(ShortcutHelper.EXTRA_SOURCE, mSource);
|
| + outState.putLong(ShortcutHelper.EXTRA_THEME_COLOR, mThemeColor);
|
| }
|
|
|
| /**
|
| @@ -116,6 +123,7 @@ public class WebappInfo {
|
| mTitle = newInfo.mTitle;
|
| mOrientation = newInfo.mOrientation;
|
| mSource = newInfo.mSource;
|
| + mThemeColor = newInfo.mThemeColor;
|
| }
|
|
|
| public boolean isInitialized() {
|
| @@ -146,6 +154,10 @@ public class WebappInfo {
|
| return mSource;
|
| }
|
|
|
| + public long themeColor() {
|
| + return mThemeColor;
|
| + }
|
| +
|
| // This is needed for clients that want to send the icon trough an intent.
|
| public String getEncodedIcon() {
|
| if (mIcon == null) return "";
|
|
|