Commit 5e98dbff authored by Theresa's avatar Theresa Committed by Commit Bot

[Modern] Fix tint for tablet tab switcher new tab button

BUG=877916

Change-Id: I6f3d4131fa3205170d2234c892471a4bbaf2323e
Reviewed-on: https://chromium-review.googlesource.com/1191125Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586386}
parent df15dab5
......@@ -18,6 +18,7 @@ import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.device.DeviceClassManager;
import org.chromium.ui.base.DeviceFormFactor;
/**
* Button for creating new tabs.
......@@ -45,6 +46,7 @@ public class NewTabButton extends Button implements Drawable.Callback {
mModernDrawable.setBounds(
0, 0, mModernDrawable.getIntrinsicWidth(), mModernDrawable.getIntrinsicHeight());
mModernDrawable.setCallback(this);
updateDrawableTint();
}
/**
......@@ -125,11 +127,13 @@ public class NewTabButton extends Button implements Drawable.Callback {
/** Update the tint for the icon drawable for Chrome Modern. */
private void updateDrawableTint() {
final boolean shouldUseLightMode = mIsNativeReady
&& (DeviceClassManager.enableAccessibilityLayout()
|| ChromeFeatureList.isEnabled(
ChromeFeatureList.HORIZONTAL_TAB_SWITCHER_ANDROID))
&& mIsIncognito;
final boolean shouldUseLightMode =
DeviceFormFactor.isNonMultiDisplayContextOnTablet(getContext())
|| (mIsNativeReady
&& (DeviceClassManager.enableAccessibilityLayout()
|| ChromeFeatureList.isEnabled(
ChromeFeatureList.HORIZONTAL_TAB_SWITCHER_ANDROID))
&& mIsIncognito);
mModernDrawable.setTintList(shouldUseLightMode ? mLightModeTint : mDarkModeTint);
}
}
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