Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm

Issue 2768933005: Use CollectionViewTextItem instead of a cast (Closed)
Patch Set: Remove MDFRoboto Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm b/ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm
index 4143e7da59ad5ce75adcd901590184d09746ed99..5e65e4fc9e00944191e55f6b7b41951bfa51065f 100644
--- a/ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm
@@ -332,6 +332,7 @@ const int kMaxTimesHistoryNoticeShown = 1;
initWithType:ItemTypeClearBrowsingDataButton] autorelease];
clearButtonItem.text = l10n_util::GetNSString(IDS_IOS_CLEAR_BUTTON);
clearButtonItem.accessibilityTraits |= UIAccessibilityTraitButton;
+ clearButtonItem.textColor = [[MDCPalette cr_redPalette] tint500];
[model addItem:clearButtonItem
toSectionWithIdentifier:SectionIdentifierClearBrowsingDataButton];
@@ -498,23 +499,6 @@ const int kMaxTimesHistoryNoticeShown = 1;
return timeRangeItem;
}
-#pragma mark UICollectionViewDataSource
-
-- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView
- cellForItemAtIndexPath:(NSIndexPath*)indexPath {
- UICollectionViewCell* cell =
- [super collectionView:collectionView cellForItemAtIndexPath:indexPath];
-
- NSInteger type = [self.collectionViewModel itemTypeForIndexPath:indexPath];
- if (type == ItemTypeClearBrowsingDataButton) {
- MDCCollectionViewTextCell* textCell =
- base::mac::ObjCCastStrict<MDCCollectionViewTextCell>(cell);
- textCell.textLabel.textColor = [[MDCPalette cr_redPalette] tint500];
- }
-
- return cell;
-}
-
#pragma mark UICollectionViewDelegate
- (void)collectionView:(UICollectionView*)collectionView

Powered by Google App Engine
This is Rietveld 408576698