Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java

Issue 1234653004: webapps: utilize manifest theme colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mounir's comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
index 0d5ca4d166536798505232c421e02d634e2824f7..0a7b9a1846394c75d1f967b84da297fd6965fa45 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
@@ -262,6 +262,11 @@ public class WebappActivity extends FullScreenActivity {
? getActivityTab().getTitle() : mWebappInfo.title();
Bitmap icon = mWebappInfo.icon() == null
? getActivityTab().getFavicon() : mWebappInfo.icon();
+
+ if (mBrandColor == null
+ && mWebappInfo.themeColor() != ShortcutHelper.THEME_COLOR_INVALID_OR_MISSING) {
+ mBrandColor = (int) mWebappInfo.themeColor();
+ }
mlamouri (slow - plz ping) 2015/07/20 13:03:30 Not related to your change but I'm surprised to se
Lalit Maganti 2015/07/20 13:15:19 Looks like it. Should I remove that check?
mlamouri (slow - plz ping) 2015/07/20 13:29:45 Not in this CL but feel free to look into it.
int color = mBrandColor == null
? getResources().getColor(R.color.default_primary_color) : mBrandColor;
@@ -330,7 +335,7 @@ public class WebappActivity extends FullScreenActivity {
* @param orientation Default orientation for the activity.
*/
public static void launchInstance(Context context, String id, String url, String icon,
- String title, int orientation, int source) {
+ String title, int orientation, int source, long themeColor) {
String activityName = WebappActivity.class.getName();
if (!FeatureUtilities.isDocumentModeEligible(context)) {
// Specifically assign the app to a particular WebappActivity instance.
@@ -347,6 +352,7 @@ public class WebappActivity extends FullScreenActivity {
webappIntent.putExtra(ShortcutHelper.EXTRA_TITLE, title);
webappIntent.putExtra(ShortcutHelper.EXTRA_ORIENTATION, orientation);
webappIntent.putExtra(ShortcutHelper.EXTRA_SOURCE, source);
+ webappIntent.putExtra(ShortcutHelper.EXTRA_THEME_COLOR, themeColor);
// On L, firing intents with the exact same data should relaunch a particular Activity.
webappIntent.setAction(Intent.ACTION_VIEW);

Powered by Google App Engine
This is Rietveld 408576698