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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/document/DocumentUtils.java

Issue 1372883002: Revert of Move status bar color setting to ChromeActivity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/document/DocumentUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentUtils.java
index 250a214fdca489a4dd9326a10e506ea41a40a2fd..205856b3f488113416721165ea12599c5cc0009b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentUtils.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.document;
import android.annotation.TargetApi;
+import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManager.AppTask;
import android.app.ActivityManager.RecentTaskInfo;
@@ -12,14 +13,18 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
+import android.graphics.Bitmap;
+import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
+import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ApplicationStatus;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tabmodel.document.ActivityDelegate;
+import org.chromium.chrome.browser.util.ColorUtils;
import java.util.ArrayList;
import java.util.List;
@@ -30,6 +35,22 @@
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public class DocumentUtils {
public static final String TAG = "DocumentUtilities";
+
+ /**
+ * Update the Recents entry for the Activity.
+ * @param activity Activity to change the entry for.
+ * @param title Title to show on the card.
+ * @param icon Icon to show on the card.
+ * @param color Color to use for the card's bar.
+ * @param useDefaultStatusBarColor Whether status bar should be set to default color.
+ */
+ public static void updateTaskDescription(Activity activity, String title, Bitmap icon,
+ int color, boolean useDefaultStatusBarColor) {
+ ApiCompatibilityUtils.setTaskDescription(activity, title, icon, color);
+ int statusBarColor = useDefaultStatusBarColor
+ ? Color.BLACK : ColorUtils.getDarkenedColorForStatusBar(color);
+ ApiCompatibilityUtils.setStatusBarColor(activity.getWindow(), statusBarColor);
+ }
/**
* Finishes tasks other than the one with the given task ID that were started with the given

Powered by Google App Engine
This is Rietveld 408576698