| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/content_suggestions/cells/content_suggestions_tex
t_item.h" | 5 #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_tex
t_item.h" |
| 6 | 6 |
| 7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_cell.h
" | 7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_cell.h
" |
| 8 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion
_identifier.h" |
| 8 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" | 9 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" |
| 9 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" | 10 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
| 10 | 11 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) | 12 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." | 13 #error "This file requires ARC support." |
| 13 #endif | 14 #endif |
| 14 | 15 |
| 15 @implementation ContentSuggestionsTextItem | 16 @implementation ContentSuggestionsTextItem |
| 16 | 17 |
| 17 @synthesize text = _text; | 18 @synthesize text = _text; |
| 18 @synthesize detailText = _detailText; | 19 @synthesize detailText = _detailText; |
| 19 @synthesize suggestionIdentifier = _suggestionIdentifier; | 20 @synthesize suggestionIdentifier = _suggestionIdentifier; |
| 21 @synthesize attributes = _attributes; |
| 22 @synthesize delegate = _delegate; |
| 23 @synthesize image = _image; |
| 20 | 24 |
| 21 - (instancetype)initWithType:(NSInteger)type { | 25 - (instancetype)initWithType:(NSInteger)type { |
| 22 self = [super initWithType:type]; | 26 self = [super initWithType:type]; |
| 23 if (self) { | 27 if (self) { |
| 24 self.cellClass = [CollectionViewTextCell class]; | 28 self.cellClass = [CollectionViewTextCell class]; |
| 25 } | 29 } |
| 26 return self; | 30 return self; |
| 27 } | 31 } |
| 28 | 32 |
| 29 - (void)configureCell:(CollectionViewTextCell*)cell { | 33 - (void)configureCell:(CollectionViewTextCell*)cell { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 cell.isAccessibilityElement = YES; | 45 cell.isAccessibilityElement = YES; |
| 42 if (self.detailText.length == 0) { | 46 if (self.detailText.length == 0) { |
| 43 cell.accessibilityLabel = self.text; | 47 cell.accessibilityLabel = self.text; |
| 44 } else { | 48 } else { |
| 45 cell.accessibilityLabel = | 49 cell.accessibilityLabel = |
| 46 [NSString stringWithFormat:@"%@, %@", self.text, self.detailText]; | 50 [NSString stringWithFormat:@"%@, %@", self.text, self.detailText]; |
| 47 } | 51 } |
| 48 } | 52 } |
| 49 | 53 |
| 50 @end | 54 @end |
| OLD | NEW |