Commit 8d90c018 authored by Tommy Martino's avatar Tommy Martino Committed by Commit Bot

[Cryptids] Fix Doodle overlap bug

Cryptid rendering should be disabled whenever a Doodle is displayed.
Currently, this condition is occasionally violated due to caching: we
sometimes receive a cached response that there is no logo, followed
by a fresh indication that actually there is one, but the first will have
triggered cryptid rendering, causing overlapping.

This CL solves this bug by invoking the OnLogoAvailable callback in the
LogoService in the Revalidated case (which corresponds to a confirmation
from the server that no logo is available), and tightening the
conditions in NewTabPageLayout to pick up this new invocation.

Bug: 1125889

Change-Id: Iceb36ebd5aa6eaebe6ec4064951eac4c3510feb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443890
Commit-Queue: Tommy Martino <tmartino@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814415}
parent 41cb2271
......@@ -490,6 +490,10 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
mLogoDelegate.getSearchProviderLogo((logo, fromCache) -> {
if (logo == null) {
if (fromCache) {
return;
}
if (mSearchProviderIsGoogle) {
// We received a null logo and the provider is Google; this means there's no
// doodle.
......@@ -508,8 +512,6 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
renderer.recordRenderEvent();
}));
}
if (fromCache) return;
}
mSearchProviderLogoView.setDelegate(mLogoDelegate);
......
......@@ -92,10 +92,6 @@ void ObserverOnLogoAvailable(LogoObserver* observer,
break;
case LogoCallbackReason::REVALIDATED:
// TODO(sfiera): double-check whether we should inform the observer of the
// fresh metadata.
break;
case LogoCallbackReason::DETERMINED:
observer->OnLogoAvailable(logo ? &logo.value() : nullptr, from_cache);
break;
......
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