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; ...@@ -18,6 +18,7 @@ import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.device.DeviceClassManager; import org.chromium.chrome.browser.device.DeviceClassManager;
import org.chromium.ui.base.DeviceFormFactor;
/** /**
* Button for creating new tabs. * Button for creating new tabs.
...@@ -45,6 +46,7 @@ public class NewTabButton extends Button implements Drawable.Callback { ...@@ -45,6 +46,7 @@ public class NewTabButton extends Button implements Drawable.Callback {
mModernDrawable.setBounds( mModernDrawable.setBounds(
0, 0, mModernDrawable.getIntrinsicWidth(), mModernDrawable.getIntrinsicHeight()); 0, 0, mModernDrawable.getIntrinsicWidth(), mModernDrawable.getIntrinsicHeight());
mModernDrawable.setCallback(this); mModernDrawable.setCallback(this);
updateDrawableTint();
} }
/** /**
...@@ -125,11 +127,13 @@ public class NewTabButton extends Button implements Drawable.Callback { ...@@ -125,11 +127,13 @@ public class NewTabButton extends Button implements Drawable.Callback {
/** Update the tint for the icon drawable for Chrome Modern. */ /** Update the tint for the icon drawable for Chrome Modern. */
private void updateDrawableTint() { private void updateDrawableTint() {
final boolean shouldUseLightMode = mIsNativeReady final boolean shouldUseLightMode =
DeviceFormFactor.isNonMultiDisplayContextOnTablet(getContext())
|| (mIsNativeReady
&& (DeviceClassManager.enableAccessibilityLayout() && (DeviceClassManager.enableAccessibilityLayout()
|| ChromeFeatureList.isEnabled( || ChromeFeatureList.isEnabled(
ChromeFeatureList.HORIZONTAL_TAB_SWITCHER_ANDROID)) ChromeFeatureList.HORIZONTAL_TAB_SWITCHER_ANDROID))
&& mIsIncognito; && mIsIncognito);
mModernDrawable.setTintList(shouldUseLightMode ? mLightModeTint : mDarkModeTint); 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