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

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

Issue 2588713002: Upstream Chrome on iOS source code [4/11]. (Closed)
Patch Set: Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
6
7 #import "base/logging.h"
8 #import "ios/third_party/material_components_ios/src/components/CollectionCells/ src/MaterialCollectionCells.h"
9
10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support."
12 #endif
13
14 @implementation CollectionViewItem
15
16 @synthesize type = _type;
17 @synthesize cellClass = _cellClass;
18 @synthesize accessibilityIdentifier = _accessibilityIdentifier;
19
20 - (instancetype)initWithType:(NSInteger)type {
21 if ((self = [super init])) {
22 _type = type;
23 _cellClass = [MDCCollectionViewCell class];
24 }
25 return self;
26 }
27
28 - (instancetype)init {
29 NOTREACHED();
30 return nil;
31 }
32
33 - (void)setCellClass:(Class)cellClass {
34 DCHECK([cellClass isSubclassOfClass:[MDCCollectionViewCell class]]);
35 _cellClass = cellClass;
36 }
37
38 - (void)configureCell:(MDCCollectionViewCell*)cell {
39 DCHECK([cell class] == self.cellClass);
40 cell.accessibilityTraits = self.accessibilityTraits;
41 cell.accessibilityIdentifier = self.accessibilityIdentifier;
42 }
43
44 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698