Commit 85726dfc authored by Theresa's avatar Theresa Committed by Commit Bot

[Modern] Hide toolbar shadow on interstitials

BUG=814880

Change-Id: I1c4bab6db1d53b4cf91b4a549c286dd7d39789bb
Reviewed-on: https://chromium-review.googlesource.com/1138869Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575450}
parent 6cded335
......@@ -1865,7 +1865,9 @@ public class ToolbarPhone extends ToolbarLayout
assert mTextureCaptureMode != textureMode;
mTextureCaptureMode = textureMode;
if (mTextureCaptureMode) {
if (!hideShadowForIncognitoNtp()) mToolbarShadow.setVisibility(VISIBLE);
if (!hideShadowForIncognitoNtp() && !hideShadowForInterstitial()) {
mToolbarShadow.setVisibility(VISIBLE);
}
mPreTextureCaptureAlpha = getAlpha();
setAlpha(1);
} else {
......@@ -2525,7 +2527,8 @@ public class ToolbarPhone extends ToolbarLayout
protected boolean shouldDrawShadow() {
// TODO(twellington): Move this shadow state information to ToolbarDataProvider and show
// shadow when incognito NTP is scrolled.
return mTabSwitcherState == STATIC_TAB && !hideShadowForIncognitoNtp();
return mTabSwitcherState == STATIC_TAB && !hideShadowForIncognitoNtp()
&& !hideShadowForInterstitial();
}
private boolean hideShadowForIncognitoNtp() {
......@@ -2533,6 +2536,12 @@ public class ToolbarPhone extends ToolbarLayout
&& NewTabPage.isNTPUrl(getToolbarDataProvider().getCurrentUrl());
}
private boolean hideShadowForInterstitial() {
return mLocationBar.useModernDesign() && getToolbarDataProvider() != null
&& getToolbarDataProvider().getTab() != null
&& getToolbarDataProvider().getTab().isShowingInterstitialPage();
}
private @VisualState int computeVisualState(boolean isInTabSwitcherMode) {
if (isInTabSwitcherMode && isIncognito()) return VisualState.TAB_SWITCHER_INCOGNITO;
if (isInTabSwitcherMode && !isIncognito()) return VisualState.TAB_SWITCHER_NORMAL;
......
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