Commit 000b58f8 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Toolbar: Fix a bug with 3rd-party search vendor

The search box scroll listener needs updating whenever search engine
provider changes. It was prevented by a small optimization
introduced in https://crrev.com/c/2500389 which updates the listener
only when there's a new visible NTP. This CL fixes the bug by removing
the line added in the culprit CL.

Bug: 1145981
Change-Id: I674d82546e5bf9f2067cf26f3413c57bf8dc35b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521977Reviewed-by: default avatarFilip Gorski <fgorski@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825224}
parent 2602945c
......@@ -813,7 +813,6 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve
@Override
public void setSearchBoxScrollListener(Callback<Float> scrollCallback) {
NewTabPage newVisibleNtp = getNewTabPageForCurrentTab();
if (mVisibleNtp == newVisibleNtp) return;
if (mVisibleNtp != null) mVisibleNtp.setSearchBoxScrollListener(null);
mVisibleNtp = newVisibleNtp;
if (mVisibleNtp != null && shouldUpdateListener()) {
......@@ -867,6 +866,12 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve
};
} else if (toolbarLayout instanceof ToolbarTablet) {
return new ToolbarNtpDelegate() {
@Override
public void setSearchBoxScrollListener(Callback<Float> scrollCallback) {
if (mVisibleNtp == getNewTabPageForCurrentTab()) return;
super.setSearchBoxScrollListener(scrollCallback);
}
@Override
protected boolean shouldUpdateListener() {
return true;
......
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