Commit 5f82ce7d authored by Yi Su's avatar Yi Su Committed by Commit Bot

Remove feature flag kOptionalArticleThumbnail

The feature "Article suggestion UI tweaks - Chrome iOS" has been shipped
in M77. The feature flag can be removed now.

Bug: 979143
Change-Id: I1be8aaae408236d4141dc61c214b11eba94292aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1886613
Commit-Queue: Yi Su <mrsuyi@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710327}
parent 4ddc16ab
......@@ -497,10 +497,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
{"toolbar-new-tab-button", flag_descriptions::kToolbarNewTabButtonName,
flag_descriptions::kToolbarNewTabButtonDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kToolbarNewTabButton)},
{"optional-article-thumbnail",
flag_descriptions::kOptionalArticleThumbnailName,
flag_descriptions::kOptionalArticleThumbnailDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kOptionalArticleThumbnail)},
{"enable-sync-uss-nigori", flag_descriptions::kEnableSyncUSSNigoriName,
flag_descriptions::kEnableSyncUSSNigoriDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(switches::kSyncUSSNigori)},
......
......@@ -278,12 +278,6 @@ const char kOmniboxOnDeviceHeadSuggestionsDescription[] =
"Shows Google head non personalized search suggestions provided by a "
"compact on device model";
const char kOptionalArticleThumbnailName[] =
"Enable optional thumbnails for NTP articles";
const char kOptionalArticleThumbnailDescription[] =
"Make thumbnails of NTP articles optional due to European copyright "
"directive(EUCD). Also change the layout of article cells";
const char kPasswordLeakDetectionName[] = "Password Leak Detection";
const char kPasswordLeakDetectionDescription[] =
"Enables the detection of leaked passwords.";
......
......@@ -236,11 +236,6 @@ extern const char kOmniboxUseDefaultSearchEngineFaviconDescription[];
extern const char kOmniboxOnDeviceHeadSuggestionsName[];
extern const char kOmniboxOnDeviceHeadSuggestionsDescription[];
// Title and description for the flag to enable optional thumbnail for NTP
// articles according to European copyright directive(EUCD).
extern const char kOptionalArticleThumbnailName[];
extern const char kOptionalArticleThumbnailDescription[];
// Title and description for the flag to enable leak detection for entered
// credentials.
extern const char kPasswordLeakDetectionName[];
......
......@@ -190,10 +190,7 @@ const CGFloat kAnimationDuration = 0.3;
[additionalInfoLabel sizeThatFits:sizeForLabels].height;
labelHeight += MAX(additionalInfoHeight, kFaviconSize);
// Add extra space at the bottom for separators between cells.
if (base::FeatureList::IsEnabled(kOptionalArticleThumbnail)) {
return MAX(minimalHeight, labelHeight) + kStandardSpacing;
}
return MAX(minimalHeight, labelHeight);
return MAX(minimalHeight, labelHeight) + kStandardSpacing;
}
#pragma mark - UICollectionViewCell
......@@ -296,50 +293,27 @@ const CGFloat kAnimationDuration = 0.3;
AddSameConstraints(_contentImageView, _imageContainer);
// For standard layout, the image container should be aligned to the right
// border if kOptionalArticleThumbnail is enabled, otherwise the left border.
if (base::FeatureList::IsEnabled(kOptionalArticleThumbnail)) {
// Prevent _additionalInformationLabel from overlapping with _titleLabel
// when a11y font size is used.
[_additionalInformationLabel.topAnchor
constraintGreaterThanOrEqualToAnchor:_titleLabel.bottomAnchor
constant:kSmallSpacing]
.active = YES;
_imageTitleHorizontalSpacing = [_imageContainer.leadingAnchor
constraintEqualToAnchor:_titleLabel.trailingAnchor
constant:kStandardSpacing];
_standardConstraints = @[
_imageTitleHorizontalSpacing,
[_titleLabel.topAnchor constraintEqualToAnchor:_imageContainer.topAnchor],
[_titleLabel.leadingAnchor
constraintEqualToAnchor:self.contentView.leadingAnchor
constant:kStandardSpacing],
[_imageContainer.trailingAnchor
constraintEqualToAnchor:self.contentView.trailingAnchor
constant:-kStandardSpacing],
];
} else {
[_imageContainer.bottomAnchor
constraintLessThanOrEqualToAnchor:_faviconView.bottomAnchor]
.active = YES;
_imageTitleHorizontalSpacing = [_titleLabel.leadingAnchor
constraintEqualToAnchor:_imageContainer.trailingAnchor
constant:kStandardSpacing];
_standardConstraints = @[
_imageTitleHorizontalSpacing,
[_titleLabel.topAnchor constraintEqualToAnchor:_imageContainer.topAnchor],
[_imageContainer.leadingAnchor
constraintEqualToAnchor:self.contentView.leadingAnchor
constant:kStandardSpacing],
[_titleLabel.trailingAnchor
constraintEqualToAnchor:self.contentView.trailingAnchor
constant:-kStandardSpacing],
];
}
// Prevent _additionalInformationLabel from overlapping with _titleLabel when
// a11y font size is used.
[_additionalInformationLabel.topAnchor
constraintGreaterThanOrEqualToAnchor:_titleLabel.bottomAnchor
constant:kSmallSpacing]
.active = YES;
_imageTitleHorizontalSpacing = [_imageContainer.leadingAnchor
constraintEqualToAnchor:_titleLabel.trailingAnchor
constant:kStandardSpacing];
_standardConstraints = @[
_imageTitleHorizontalSpacing,
[_titleLabel.topAnchor constraintEqualToAnchor:_imageContainer.topAnchor],
[_titleLabel.leadingAnchor
constraintEqualToAnchor:self.contentView.leadingAnchor
constant:kStandardSpacing],
[_imageContainer.trailingAnchor
constraintEqualToAnchor:self.contentView.trailingAnchor
constant:-kStandardSpacing],
];
// For a11y layout, the image container is always aligned to the left border.
_imageTitleVerticalSpacing = [_titleLabel.topAnchor
......
......@@ -401,19 +401,6 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
CGSize size = [super collectionView:collectionView
layout:collectionViewLayout
sizeForItemAtIndexPath:indexPath];
// No need to add extra spacing if kOptionalArticleThumbnail is enabled,
// because each cell already has spacing at top and bottom for separators.
if (base::FeatureList::IsEnabled(kOptionalArticleThumbnail)) {
return size;
}
// Special case for last item to add extra spacing before the footer.
if ([self.collectionUpdater isContentSuggestionsSection:indexPath.section] &&
indexPath.row ==
[self.collectionView numberOfItemsInSection:indexPath.section] - 1) {
size.height += [ContentSuggestionsCell standardSpacing];
}
return size;
}
......@@ -528,21 +515,9 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
- (BOOL)collectionView:(UICollectionView*)collectionView
shouldHideItemSeparatorAtIndexPath:(NSIndexPath*)indexPath {
// If kOptionalArticleThumbnail is enabled, show separators for all cells in
// content suggestion sections.
if (base::FeatureList::IsEnabled(kOptionalArticleThumbnail)) {
return !
[self.collectionUpdater isContentSuggestionsSection:indexPath.section];
}
// Special case, show a seperator between the last regular item and the
// footer.
if (![self.collectionUpdater
shouldUseCustomStyleForSection:indexPath.section] &&
indexPath.row ==
[self.collectionView numberOfItemsInSection:indexPath.section] - 1) {
return NO;
}
return YES;
// Show separators for all cells in content suggestion sections.
return !
[self.collectionUpdater isContentSuggestionsSection:indexPath.section];
}
- (BOOL)collectionView:(UICollectionView*)collectionView
......
......@@ -72,11 +72,7 @@ ContentSuggestionsItem* ConvertSuggestion(
contentSuggestion.reading_list_suggestion_extra()->favicon_page_url;
}
if (category.IsKnownCategory(ntp_snippets::KnownCategories::ARTICLES)) {
if (base::FeatureList::IsEnabled(kOptionalArticleThumbnail)) {
suggestion.hasImage = contentSuggestion.salient_image_url().is_valid();
} else {
suggestion.hasImage = YES;
}
suggestion.hasImage = contentSuggestion.salient_image_url().is_valid();
suggestion.readLaterAction = YES;
}
......
......@@ -28,9 +28,6 @@ const base::Feature kOmniboxUseDefaultSearchEngineFavicon{
const base::Feature kLanguageSettings{"LanguageSettings",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kOptionalArticleThumbnail{"OptionalArticleThumbnail",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kEmbedderBlockRestoreUrl{"EmbedderBlockRestoreUrl",
base::FEATURE_ENABLED_BY_DEFAULT};
......
......@@ -31,9 +31,6 @@ extern const base::Feature kOmniboxUseDefaultSearchEngineFavicon;
// Feature flag for the language settings page.
extern const base::Feature kLanguageSettings;
// Feature flag for the optional article thumbnail.
extern const base::Feature kOptionalArticleThumbnail;
// Feature flag for embedders to block restore urls.
extern const base::Feature kEmbedderBlockRestoreUrl;
......
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