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

Unified Diff: ios/chrome/browser/ui/settings/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/settings_collection_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm b/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm
index 23aeae65348a2eead121c50787117ff720149f4d..5f845340534478efd9195ab32d671deaadb506c4 100644
--- a/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm
@@ -332,6 +332,7 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
CollectionViewTextItem* basicsHeader = [
[[CollectionViewTextItem alloc] initWithType:ItemTypeHeader] autorelease];
basicsHeader.text = l10n_util::GetNSString(IDS_IOS_OPTIONS_GENERAL_TAB_LABEL);
+ basicsHeader.textColor = [[MDCPalette greyPalette] tint500];
[model setHeader:basicsHeader
forSectionWithIdentifier:SectionIdentifierBasics];
[model addItem:[self searchEngineDetailItem]
@@ -349,6 +350,7 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
[[CollectionViewTextItem alloc] initWithType:ItemTypeHeader] autorelease];
advancedHeader.text =
l10n_util::GetNSString(IDS_IOS_OPTIONS_ADVANCED_TAB_LABEL);
+ advancedHeader.textColor = [[MDCPalette greyPalette] tint500];
[model setHeader:advancedHeader
forSectionWithIdentifier:SectionIdentifierAdvanced];
[model addItem:[self voiceSearchDetailItem]
@@ -371,6 +373,7 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
CollectionViewTextItem* debugHeader = [[[CollectionViewTextItem alloc]
initWithType:ItemTypeHeader] autorelease];
debugHeader.text = @"Debug";
+ debugHeader.textColor = [[MDCPalette greyPalette] tint500];
[model setHeader:debugHeader
forSectionWithIdentifier:SectionIdentifierDebug];
}
@@ -681,21 +684,6 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
return cell;
}
-- (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