Commit 0914b598 authored by David Trainor's avatar David Trainor Committed by Commit Bot

Fix Pages chip showing up at wrong time.

The pages chip in downloads home was showing up even though the pages
were prefetched and did not show up in "My Files".  This was because we
were considering the suggested pages as PAGES for filter purposes and
keeping the chip visible.  We now consider all suggested content as
PREFETCHED for the purpose of the chips.

This is NOT baked into the base
Filters.fromOfflineItem(OfflineItemFilter) logic because we do not want
to restrict the suggested tag to only pages.

Change-Id: Iad2c74b7efd2f55cab06a15e6883d3e8cc0df73e
Reviewed-on: https://chromium-review.googlesource.com/1152234Reviewed-by: default avatarShakti Sahu <shaktisahu@chromium.org>
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579385}
parent 8301a645
...@@ -158,7 +158,12 @@ public class FilterChipsProvider implements ChipsProvider, OfflineItemFilterObse ...@@ -158,7 +158,12 @@ public class FilterChipsProvider implements ChipsProvider, OfflineItemFilterObse
Set</* @FilterType */ Integer> filters = new HashSet<>(); Set</* @FilterType */ Integer> filters = new HashSet<>();
filters.add(Filters.FilterType.NONE); filters.add(Filters.FilterType.NONE);
for (OfflineItem item : mSource.getItems()) { for (OfflineItem item : mSource.getItems()) {
filters.add(Filters.fromOfflineItem(item.filter)); if (item.isSuggested) {
// All suggested content is considered prefetched and is not included in the chips.
filters.add(FilterType.PREFETCHED);
} else {
filters.add(Filters.fromOfflineItem(item.filter));
}
} }
// Set the enabled states correctly for all chips. // Set the enabled states correctly for all chips.
......
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