Commit 84464d87 authored by gogerald's avatar gogerald Committed by Commit Bot

[StartSurface] Set url bar text back after finished hiding the tab switcher

getCurrentUrl returns the NTP url in overview mode after this CL
https://chromium-review.googlesource.com/c/chromium/src/+/1894293
Overview mode is considered visible before finished hiding.
So, previously, getUrlBarData in handleOmniboxInOverviewMode would return the data for overview mode.
In this CL, I moved the update to after finished hiding the tab switcher.

Bug: 1049847
Change-Id: I08e7508ec3426314d924b008bb2e472103ae77e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088020Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Commit-Queue: Ganggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747770}
parent 5a1d6fed
......@@ -1924,12 +1924,7 @@ public class ToolbarPhone extends ToolbarLayout implements Invalidator.Client, O
triggerUrlFocusAnimation(inTabSwitcherMode && !urlHasFocus());
if (inTabSwitcherMode) {
mUrlBar.setText("");
} else if (getToolbarDataProvider() != null
&& getToolbarDataProvider().getUrlBarData() != null) {
mUrlBar.setText(getToolbarDataProvider().getUrlBarData().displayText);
}
if (inTabSwitcherMode) mUrlBar.setText("");
return true;
}
......@@ -1965,6 +1960,14 @@ public class ToolbarPhone extends ToolbarLayout implements Invalidator.Client, O
} else {
updateViewsForTabSwitcherMode();
}
// Set the url bar text back after finished hiding the tab switcher.
if (getToolbarDataProvider().shouldShowLocationBarInOverviewMode()
&& mTabSwitcherState == STATIC_TAB && getToolbarDataProvider() != null
&& getToolbarDataProvider().getUrlBarData() != null) {
assert !getToolbarDataProvider().isInOverviewAndShowingOmnibox();
mUrlBar.setText(getToolbarDataProvider().getUrlBarData().displayText);
}
}
@Override
......
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