Commit b9245dd7 authored by adamta's avatar adamta Committed by Commit Bot

[iOS] Change Discover feed header visbility in all tabs

Updates collection updater's feed visibility to change header when feed
visibility is changed from a different tab.

Bug: 1126890, 1085419
Change-Id: I7bf3c3e7069c92940cade77973a050293451827c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2405624
Commit-Queue: Adam Trudeau-Arcaro <adamta@google.com>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806207}
parent b1f4b048
...@@ -8,8 +8,13 @@ ...@@ -8,8 +8,13 @@
// Consumer protocol for the content suggestions view controller. // Consumer protocol for the content suggestions view controller.
@protocol ContentSuggestionsConsumer @protocol ContentSuggestionsConsumer
// Notifies the consumer to set the content suggestions enabled // Notifies the consumer to set the content suggestions enabled
// based on the user setting. // based on the user setting. Setting the feed to disabled removes the section
// entirely, including the feed header.
- (void)setContentSuggestionsEnabled:(BOOL)enabled; - (void)setContentSuggestionsEnabled:(BOOL)enabled;
// Notifies the consumer to set the content suggestions visibility
// based on the user setting. Setting the feed to invisible hides the feed
// content, but retains the feed header.
- (void)setContentSuggestionsVisible:(BOOL)visible;
@end @end
#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_CONSUMER_H_ #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_CONSUMER_H_
...@@ -618,6 +618,8 @@ const NSInteger kMaxNumMostVisitedTiles = 4; ...@@ -618,6 +618,8 @@ const NSInteger kMaxNumMostVisitedTiles = 4;
ContentSuggestionsSectionInformation* sectionInfo = ContentSuggestionsSectionInformation* sectionInfo =
self.sectionInformationByCategory[wrapper]; self.sectionInformationByCategory[wrapper];
sectionInfo.expanded = [self.contentArticlesExpanded value]; sectionInfo.expanded = [self.contentArticlesExpanded value];
[self.consumer
setContentSuggestionsVisible:[self.contentArticlesExpanded value]];
if (allData) { if (allData) {
[self reloadAllData]; [self reloadAllData];
......
...@@ -808,6 +808,10 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix = ...@@ -808,6 +808,10 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
_contentSuggestionsEnabled = enabled; _contentSuggestionsEnabled = enabled;
} }
- (void)setContentSuggestionsVisible:(BOOL)visible {
[self.collectionUpdater changeDiscoverFeedHeaderVisibility:visible];
}
#pragma mark - NSKeyValueObserving #pragma mark - NSKeyValueObserving
// TODO(crbug.com/1114792): Remove once we stop containing the DiscoverFeed // TODO(crbug.com/1114792): Remove once we stop containing the DiscoverFeed
......
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