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

Unified Diff: ios/chrome/browser/ui/settings/sync_settings_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/sync_settings_collection_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm b/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm
index 5e0a6704be2073d3bf528c40d0186982fad7e1e7..0632a09b8558ae51d52bbdb29207a196537b345e 100644
--- a/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm
@@ -270,6 +270,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
CollectionViewTextItem* syncToHeader = [[[CollectionViewTextItem alloc]
initWithType:ItemTypeHeader] autorelease];
syncToHeader.text = l10n_util::GetNSString(IDS_IOS_SYNC_TO_TITLE);
+ syncToHeader.textColor = [[MDCPalette greyPalette] tint500];
[model setHeader:syncToHeader
forSectionWithIdentifier:SectionIdentifierSyncAccounts];
ProfileOAuth2TokenService* oauth2_service =
@@ -296,6 +297,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
[[CollectionViewTextItem alloc] initWithType:ItemTypeHeader] autorelease];
syncServicesHeader.text =
l10n_util::GetNSString(IDS_IOS_SYNC_DATA_TYPES_TITLE);
+ syncServicesHeader.textColor = [[MDCPalette greyPalette] tint500];
[model setHeader:syncServicesHeader
forSectionWithIdentifier:SectionIdentifierSyncServices];
BOOL syncEverythingEnabled = _syncSetupService->IsSyncingAllDataTypes();
@@ -465,23 +467,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
return cell;
}
-// Method for overriding the header view of a section. Used to set the header
-// text color to gray.
-- (UICollectionReusableView*)collectionView:(UICollectionView*)collectionView
- viewForSupplementaryElementOfKind:(NSString*)kind
- atIndexPath:(NSIndexPath*)indexPath {
- UICollectionReusableView* view = [super collectionView:collectionView
- viewForSupplementaryElementOfKind:kind
- atIndexPath:indexPath];
-
- MDCCollectionViewTextCell* textCell =
- base::mac::ObjCCast<MDCCollectionViewTextCell>(view);
- if (textCell) {
- textCell.textLabel.textColor = [[MDCPalette greyPalette] tint500];
- }
- return view;
-}
-
#pragma mark UICollectionViewDelegate
- (void)collectionView:(UICollectionView*)collectionView

Powered by Google App Engine
This is Rietveld 408576698