Commit 6a98570f authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Allow home button when Start surface is on

Before this CL, home button would be hidden when Start surface is on,
except for the single-pane variation.

Bug: 1055561
Change-Id: I8dd7862dffcb42fab77eaf1829ce441d30a5ea34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2112330
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756090}
parent 96d52edb
...@@ -91,6 +91,8 @@ public class StartSurfaceTest { ...@@ -91,6 +91,8 @@ public class StartSurfaceTest {
@Feature({"StartSurface"}) @Feature({"StartSurface"})
@CommandLineFlags.Add({BASE_PARAMS + "/tasksonly"}) @CommandLineFlags.Add({BASE_PARAMS + "/tasksonly"})
public void testShowAndHide_TasksOnlySurface() { public void testShowAndHide_TasksOnlySurface() {
onView(withId(R.id.home_button)).check(matches(isDisplayed()));
TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity()); TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity());
onView(withId(R.id.primary_tasks_surface_view)).check(matches(isDisplayed())); onView(withId(R.id.primary_tasks_surface_view)).check(matches(isDisplayed()));
...@@ -112,6 +114,8 @@ public class StartSurfaceTest { ...@@ -112,6 +114,8 @@ public class StartSurfaceTest {
"/hide_switch_when_no_incognito_tabs/true"}) "/hide_switch_when_no_incognito_tabs/true"})
public void testShowAndHide_OmniboxOnlySurface() { public void testShowAndHide_OmniboxOnlySurface() {
// clang-format on // clang-format on
onView(withId(R.id.home_button)).check(matches(isDisplayed()));
final ChromeTabbedActivity cta = mActivityTestRule.getActivity(); final ChromeTabbedActivity cta = mActivityTestRule.getActivity();
TabUiTestHelper.enterTabSwitcher(cta); TabUiTestHelper.enterTabSwitcher(cta);
...@@ -147,6 +151,8 @@ public class StartSurfaceTest { ...@@ -147,6 +151,8 @@ public class StartSurfaceTest {
@Feature({"StartSurface"}) @Feature({"StartSurface"})
@CommandLineFlags.Add({BASE_PARAMS + "/twopanes"}) @CommandLineFlags.Add({BASE_PARAMS + "/twopanes"})
public void testShowAndHide_TwoPanesSurface() { public void testShowAndHide_TwoPanesSurface() {
onView(withId(R.id.home_button)).check(matches(isDisplayed()));
final ChromeTabbedActivity cta = mActivityTestRule.getActivity(); final ChromeTabbedActivity cta = mActivityTestRule.getActivity();
TabUiTestHelper.enterTabSwitcher(cta); TabUiTestHelper.enterTabSwitcher(cta);
...@@ -354,6 +360,8 @@ public class StartSurfaceTest { ...@@ -354,6 +360,8 @@ public class StartSurfaceTest {
@Feature({"StartSurface"}) @Feature({"StartSurface"})
@CommandLineFlags.Add({BASE_PARAMS + "/single"}) @CommandLineFlags.Add({BASE_PARAMS + "/single"})
public void testShowAndHide_TabSwitcherInSingleSurface() { public void testShowAndHide_TabSwitcherInSingleSurface() {
onView(withId(R.id.home_button)).check(matches(isDisplayed()));
TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity()); TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity());
onView(withId(R.id.secondary_tasks_surface_view)).check(matches(isDisplayed())); onView(withId(R.id.secondary_tasks_surface_view)).check(matches(isDisplayed()));
......
...@@ -74,7 +74,6 @@ import org.chromium.chrome.browser.toolbar.ToolbarColors; ...@@ -74,7 +74,6 @@ import org.chromium.chrome.browser.toolbar.ToolbarColors;
import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarConfiguration; import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarConfiguration;
import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarVariationManager; import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarVariationManager;
import org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator.UrlExpansionObserver; import org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator.UrlExpansionObserver;
import org.chromium.chrome.features.start_surface.StartSurfaceConfiguration;
import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.browser_ui.styles.ChromeColors;
import org.chromium.components.browser_ui.widget.animation.CancelAwareAnimatorListener; import org.chromium.components.browser_ui.widget.animation.CancelAwareAnimatorListener;
import org.chromium.components.browser_ui.widget.animation.Interpolators; import org.chromium.components.browser_ui.widget.animation.Interpolators;
...@@ -1660,9 +1659,8 @@ public class ToolbarPhone extends ToolbarLayout implements Invalidator.Client, O ...@@ -1660,9 +1659,8 @@ public class ToolbarPhone extends ToolbarLayout implements Invalidator.Client, O
if (mHomeButton == null) return; if (mHomeButton == null) return;
boolean hideHomeButton = !mIsHomeButtonEnabled boolean hideHomeButton = !mIsHomeButtonEnabled
|| (mIsBottomToolbarVisible && BottomToolbarVariationManager.isHomeButtonOnBottom()) || (mIsBottomToolbarVisible
|| (StartSurfaceConfiguration.isStartSurfaceEnabled() && BottomToolbarVariationManager.isHomeButtonOnBottom());
&& !StartSurfaceConfiguration.isStartSurfaceSinglePaneEnabled());
if (hideHomeButton) { if (hideHomeButton) {
removeHomeButton(); removeHomeButton();
} else { } else {
......
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