Chromium Code Reviews| Index: ios/chrome/browser/payments/payment_request_selector_view_controller.mm |
| diff --git a/ios/chrome/browser/payments/payment_request_selector_view_controller.mm b/ios/chrome/browser/payments/payment_request_selector_view_controller.mm |
| index 9f60365a02e78a5107d9d64555a953547ea59e48..d0e3b18a88ec0904c3d27032ec1958748c2f3725 100644 |
| --- a/ios/chrome/browser/payments/payment_request_selector_view_controller.mm |
| +++ b/ios/chrome/browser/payments/payment_request_selector_view_controller.mm |
| @@ -16,9 +16,8 @@ |
| #import "ios/chrome/browser/ui/collection_view/collection_view_model.h" |
| #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
| #import "ios/chrome/browser/ui/icons/chrome_icon.h" |
| -#include "ios/chrome/browser/ui/uikit_ui_util.h" |
| #include "ios/chrome/grit/ios_strings.h" |
| -#include "ios/chrome/grit/ios_theme_resources.h" |
| +#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #if !defined(__has_feature) || !__has_feature(objc_arc) |
| @@ -130,6 +129,35 @@ typedef NS_ENUM(NSInteger, ItemType) { |
| UIEdgeInsetsMake(0, kSeparatorEdgeInset, 0, kSeparatorEdgeInset); |
| } |
| +#pragma mark UICollectionViewDataSource |
|
Moe
2017/04/18 13:58:18
Hopefully we won't need this once the styler API h
gambard
2017/04/18 14:34:46
Acknowledged.
|
| + |
| +- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView |
| + cellForItemAtIndexPath:(nonnull NSIndexPath*)indexPath { |
| + CollectionViewModel* model = self.collectionViewModel; |
| + |
| + UICollectionViewCell* cell = |
| + [super collectionView:collectionView cellForItemAtIndexPath:indexPath]; |
| + |
| + NSInteger itemType = [model itemTypeForIndexPath:indexPath]; |
| + switch (itemType) { |
| + case ItemTypeHeader: { |
| + if ([cell isKindOfClass:[PaymentsTextCell class]]) { |
| + PaymentsTextCell* textCell = |
| + base::mac::ObjCCastStrict<PaymentsTextCell>(cell); |
| + textCell.textLabel.textColor = |
| + self.dataSource.state == PaymentRequestSelectorStateError |
| + ? [[MDCPalette cr_redPalette] tint600] |
| + : [[MDCPalette greyPalette] tint600]; |
| + } |
| + break; |
| + } |
| + default: |
| + break; |
| + } |
| + |
| + return cell; |
| +} |
| + |
| #pragma mark UICollectionViewDelegate |
| - (void)collectionView:(UICollectionView*)collectionView |