Commit 07832750 authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Android] Remove explicit tinting of downloads icon

This CL fixes the color of the Download icon in the three-dots menu. The
appearance of this icon was broken by https://crrev.com/c/1245786.
Apparently, a color filter set on drawable by AppMenuPropertiesDelegate
overrides ImageView.setImageTintList used by ImageViewCompat on API 21+.
Fortunately, there's no need to manually tint the drawable, because
AppCompatImageButton for the Download icon is always tinted. This CL
removes the manual tinting of the drawable.

Bug: 891645
Change-Id: I9eb9f326445e044a77fa8802b6816e5bc16e0993
Reviewed-on: https://chromium-review.googlesource.com/1258987Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596305}
parent 491d1097
...@@ -7,8 +7,6 @@ package org.chromium.chrome.browser.appmenu; ...@@ -7,8 +7,6 @@ package org.chromium.chrome.browser.appmenu;
import android.content.Context; import android.content.Context;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.SystemClock; import android.os.SystemClock;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -17,7 +15,6 @@ import android.view.MenuItem; ...@@ -17,7 +15,6 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.CommandLine; import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordHistogram;
...@@ -143,14 +140,6 @@ public class AppMenuPropertiesDelegate { ...@@ -143,14 +140,6 @@ public class AppMenuPropertiesDelegate {
if (offlineMenuItem != null) { if (offlineMenuItem != null) {
offlineMenuItem.setEnabled( offlineMenuItem.setEnabled(
DownloadUtils.isAllowedToDownloadPage(currentTab)); DownloadUtils.isAllowedToDownloadPage(currentTab));
Drawable drawable = offlineMenuItem.getIcon();
if (drawable != null) {
int iconTint = ApiCompatibilityUtils.getColor(
mActivity.getResources(), R.color.default_icon_color);
drawable.mutate();
drawable.setColorFilter(iconTint, PorterDuff.Mode.SRC_ATOP);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment