Commit 9d321f69 authored by Brandon Wylie's avatar Brandon Wylie Committed by Commit Bot

Hide the search engine icon in un-focused omnibox on the NTP

Bug: 1006939
Change-Id: I80660992d19533dde83f47fb24ed358ef3a58669
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1824065Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Brandon Wylie <wylieb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700057}
parent 4ba0b61c
......@@ -128,12 +128,6 @@ public class LocationBarPhone extends LocationBarLayout {
// This offset is only required when the focus animation is running.
if (!hasFocus) return 0;
// The offset is only required when the fakebox on the NTP is showing.
if (mToolbarDataProvider.getNewTabPageForCurrentTab() != null
&& !mToolbarDataProvider.getNewTabPageForCurrentTab().isLocationBarShownInNTP()) {
return 0;
}
// We're on the NTP with the fakebox showing.
// The value returned changes based on if the layout is LTR OR RTL.
// For LTR, the value is negative because we are making space on the left-hand side.
......@@ -173,7 +167,7 @@ public class LocationBarPhone extends LocationBarLayout {
- mStatusView.getEndPaddingPixelSizeForState(false));
if (!hasFocus && mToolbarDataProvider.getNewTabPageForCurrentTab() != null
&& mToolbarDataProvider.getNewTabPageForCurrentTab().isLocationBarShownInNTP()) {
&& mIconView.getVisibility() == VISIBLE) {
// When:
// 1. unfocusing the LocationBar on the NTP.
// 2. scrolling the fakebox to the LocationBar on the NTP.
......
......@@ -384,8 +384,6 @@ class StatusMediator {
// (doesUrlMatchDefaultSearchEngine) can be removed once this is fixed.
// TODO(crbug.com/991017): Remove doesUrlMatchDefaultSearchEngine when "Query in the
// omnibox" properly reacts to dse changes.
boolean showUnfocusedNewTabPage = !mUrlHasFocus && mToolbarCommonPropertiesModel != null
&& mToolbarCommonPropertiesModel.getNewTabPageForCurrentTab() != null;
boolean showUnfocusedSearchResultsPage = !mUrlHasFocus
&& mToolbarCommonPropertiesModel != null
&& mToolbarCommonPropertiesModel.getDisplaySearchTerms() != null
......@@ -394,7 +392,7 @@ class StatusMediator {
boolean isIncognito = mToolbarCommonPropertiesModel != null
&& mToolbarCommonPropertiesModel.isIncognito();
if (mDelegate.shouldShowSearchEngineLogo(isIncognito) && mIsSearchEngineStateSetup
&& (showFocused || showUnfocusedNewTabPage || showUnfocusedSearchResultsPage)) {
&& (showFocused || showUnfocusedSearchResultsPage)) {
mShouldCancelCustomFavicon = false;
// If the current url text is a valid url, then swap the dse icon for a globe.
if (mUrlBarTextIsValidUrl) {
......
......@@ -402,7 +402,8 @@ public class LocationBarModel implements ToolbarDataProvider, ToolbarCommonPrope
switch (securityLevel) {
case ConnectionSecurityLevel.NONE:
return isSmallDevice
&& !SearchEngineLogoUtils.shouldShowSearchEngineLogo(isIncognito())
&& (!SearchEngineLogoUtils.shouldShowSearchEngineLogo(isIncognito())
|| getNewTabPageForCurrentTab() != null)
? 0
: R.drawable.omnibox_info;
case ConnectionSecurityLevel.HTTP_SHOW_WARNING:
......
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