Commit 911cdce5 authored by Becky Zhou's avatar Becky Zhou Committed by Commit Bot

[NTP OptOut] Fix cold start state for the expandable suggestion section

On cold start with a NTP opened as current tab and header is collapsed,
the suggestions status can be updated to explicitly disabled after the
UI is initialized, which removes the entire section including the
expandable header.

We should add the section back if necessary on status changed to
explicitly disabled.

Bug: 851516
Change-Id: Ied7c7737dfb22b3dc22f4a059c48f1b0793b681a
Reviewed-on: https://chromium-review.googlesource.com/1097226Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Becky Zhou <huayinz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580684}
parent 516f65a4
......@@ -167,6 +167,12 @@ public class SectionList extends InnerNode<NewTabPageViewHolder, PartialBindCall
return;
case CategoryStatus.CATEGORY_EXPLICITLY_DISABLED:
// Need to remove the entire section from the UI immediately. If the section is
// expandable, we may add the section back for displaying the header.
removeSection(mSections.get(category));
maybeAddSectionForHeader(category);
return;
case CategoryStatus.LOADING_ERROR:
// Need to remove the entire section from the UI immediately.
removeSection(mSections.get(category));
......
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