| OLD | NEW |
| 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/suggestions/suggestions_item.h" | 5 #import "ios/chrome/browser/ui/suggestions/suggestions_item.h" |
| 6 | 6 |
| 7 #import "ios/chrome/browser/ui/suggestions/suggestions_item_actions.h" | 7 #import "ios/chrome/browser/ui/suggestions/suggestions_item_actions.h" |
| 8 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" | 8 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" |
| 9 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 9 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
| 10 | 10 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) | 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." | 12 #error "This file requires ARC support." |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 @interface SuggestionsItem () | 15 @interface SuggestionsItem () |
| 16 | 16 |
| 17 @property(nonatomic, copy) NSString* title; | 17 @property(nonatomic, copy) NSString* title; |
| 18 @property(nonatomic, copy) NSString* subtitle; | 18 @property(nonatomic, copy) NSString* subtitle; |
| 19 | 19 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 49 #pragma mark - SuggestionsCell | 49 #pragma mark - SuggestionsCell |
| 50 | 50 |
| 51 @implementation SuggestionsCell | 51 @implementation SuggestionsCell |
| 52 | 52 |
| 53 @synthesize titleButton = _titleButton; | 53 @synthesize titleButton = _titleButton; |
| 54 @synthesize detailTextLabel = _detailTextLabel; | 54 @synthesize detailTextLabel = _detailTextLabel; |
| 55 | 55 |
| 56 - (instancetype)initWithFrame:(CGRect)frame { | 56 - (instancetype)initWithFrame:(CGRect)frame { |
| 57 self = [super initWithFrame:frame]; | 57 self = [super initWithFrame:frame]; |
| 58 if (self) { | 58 if (self) { |
| 59 MDFRobotoFontLoader* fontLoader = [MDFRobotoFontLoader sharedInstance]; | 59 id<MDCTypographyFontLoading> fontLoader = [MDCTypography fontLoader]; |
| 60 _titleButton = [UIButton buttonWithType:UIButtonTypeSystem]; | 60 _titleButton = [UIButton buttonWithType:UIButtonTypeSystem]; |
| 61 _titleButton.titleLabel.font = [fontLoader mediumFontOfSize:16]; | 61 _titleButton.titleLabel.font = [fontLoader mediumFontOfSize:16]; |
| 62 _titleButton.titleLabel.textColor = [[MDCPalette greyPalette] tint900]; | 62 _titleButton.titleLabel.textColor = [[MDCPalette greyPalette] tint900]; |
| 63 [_titleButton addTarget:nil | 63 [_titleButton addTarget:nil |
| 64 action:@selector(addNewItem:) | 64 action:@selector(addNewItem:) |
| 65 forControlEvents:UIControlEventTouchUpInside]; | 65 forControlEvents:UIControlEventTouchUpInside]; |
| 66 | 66 |
| 67 _detailTextLabel = [[UILabel alloc] init]; | 67 _detailTextLabel = [[UILabel alloc] init]; |
| 68 _detailTextLabel.font = [fontLoader mediumFontOfSize:14]; | 68 _detailTextLabel.font = [fontLoader mediumFontOfSize:14]; |
| 69 _detailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; | 69 _detailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 88 [self.contentView.bottomAnchor | 88 [self.contentView.bottomAnchor |
| 89 constraintEqualToAnchor:labelsStack.bottomAnchor] | 89 constraintEqualToAnchor:labelsStack.bottomAnchor] |
| 90 ]]; | 90 ]]; |
| 91 | 91 |
| 92 self.backgroundColor = [UIColor whiteColor]; | 92 self.backgroundColor = [UIColor whiteColor]; |
| 93 } | 93 } |
| 94 return self; | 94 return self; |
| 95 } | 95 } |
| 96 | 96 |
| 97 @end | 97 @end |
| OLD | NEW |