Commit e09b46d9 authored by Mia Glaese's avatar Mia Glaese Committed by Commit Bot

[Start Surface] Switch to Homepage when search accelerator is tapped.

If Tabswitcher is shown, we switch to HomePage which owns fakebox.

Bug: 1039467
Change-Id: I9a59c9dba89acc9a2644a12663fafaba054d0d95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1989867Reviewed-by: default avatarPatrick Noland <pnoland@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Commit-Queue: Mia Glaese <glamia@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729502}
parent fb19bf43
...@@ -250,7 +250,9 @@ public class ToolbarManager implements ScrimObserver, ToolbarTabController, UrlF ...@@ -250,7 +250,9 @@ public class ToolbarManager implements ScrimObserver, ToolbarTabController, UrlF
private int mCurrentOrientation; private int mCurrentOrientation;
/** Runnable for the home button when Start Surface home page is enabled. */ /**
* Runnable for the home and search accelerator button when Start Surface home page is enabled.
*/
private Supplier<Boolean> mShowStartSurfaceSupplier; private Supplier<Boolean> mShowStartSurfaceSupplier;
/** /**
...@@ -801,6 +803,11 @@ public class ToolbarManager implements ScrimObserver, ToolbarTabController, UrlF ...@@ -801,6 +803,11 @@ public class ToolbarManager implements ScrimObserver, ToolbarTabController, UrlF
final OnClickListener searchAcceleratorListener = v -> { final OnClickListener searchAcceleratorListener = v -> {
recordBottomToolbarUseForIPH(); recordBottomToolbarUseForIPH();
ACCELERATOR_BUTTON_TAP_ACTION.record(); ACCELERATOR_BUTTON_TAP_ACTION.record();
// Only switch to HomePage when overview is showing.
if (mOverviewModeBehavior.overviewVisible()) {
mShowStartSurfaceSupplier.get();
}
setUrlBarFocus(true, LocationBar.OmniboxFocusReason.ACCELERATOR_TAP); setUrlBarFocus(true, LocationBar.OmniboxFocusReason.ACCELERATOR_TAP);
}; };
......
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