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

Side by Side Diff: ios/chrome/browser/ui/collection_view/cells/collection_view_item.mm

Issue 2805273002: [Payment Request] Selector view controller (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" 5 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
6 6
7 #import "base/logging.h" 7 #import "base/logging.h"
8 #import "ios/third_party/material_components_ios/src/components/CollectionCells/ src/MaterialCollectionCells.h" 8 #import "ios/third_party/material_components_ios/src/components/CollectionCells/ src/MaterialCollectionCells.h"
9 9
10 #if !defined(__has_feature) || !__has_feature(objc_arc) 10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support." 11 #error "This file requires ARC support."
12 #endif 12 #endif
13 13
14 @implementation CollectionViewItem 14 @implementation CollectionViewItem
15 15
16 @synthesize type = _type; 16 @synthesize type = _type;
17 @synthesize cellClass = _cellClass; 17 @synthesize cellClass = _cellClass;
18 @synthesize accessibilityIdentifier = _accessibilityIdentifier; 18 @synthesize accessibilityIdentifier = _accessibilityIdentifier;
19 @synthesize accessoryType = _accessoryType;
19 20
20 - (instancetype)initWithType:(NSInteger)type { 21 - (instancetype)initWithType:(NSInteger)type {
21 if ((self = [super init])) { 22 if ((self = [super init])) {
22 _type = type; 23 _type = type;
23 _cellClass = [MDCCollectionViewCell class]; 24 _cellClass = [MDCCollectionViewCell class];
24 } 25 }
25 return self; 26 return self;
26 } 27 }
27 28
28 - (instancetype)init { 29 - (instancetype)init {
29 NOTREACHED(); 30 NOTREACHED();
30 return nil; 31 return nil;
31 } 32 }
32 33
33 - (void)setCellClass:(Class)cellClass { 34 - (void)setCellClass:(Class)cellClass {
34 DCHECK([cellClass isSubclassOfClass:[MDCCollectionViewCell class]]); 35 DCHECK([cellClass isSubclassOfClass:[MDCCollectionViewCell class]]);
35 _cellClass = cellClass; 36 _cellClass = cellClass;
36 } 37 }
37 38
38 - (void)configureCell:(MDCCollectionViewCell*)cell { 39 - (void)configureCell:(MDCCollectionViewCell*)cell {
39 DCHECK([cell class] == self.cellClass); 40 DCHECK([cell class] == self.cellClass);
40 cell.accessibilityTraits = self.accessibilityTraits; 41 cell.accessibilityTraits = self.accessibilityTraits;
41 cell.accessibilityIdentifier = self.accessibilityIdentifier; 42 cell.accessibilityIdentifier = self.accessibilityIdentifier;
43 cell.accessoryType = self.accessoryType;
42 } 44 }
43 45
44 @end 46 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698