| 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/settings/cells/encryption_item.h" | 5 #import "ios/chrome/browser/ui/settings/cells/encryption_item.h" |
| 6 | 6 |
| 7 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" | 7 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" |
| 8 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 8 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.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 namespace { | 14 namespace { |
| 15 // Padding used on the leading and trailing edges of the cell. | 15 // Padding used on the leading and trailing edges of the cell. |
| 16 const CGFloat kHorizontalPadding = 16; | 16 const CGFloat kHorizontalPadding = 16; |
| 17 | 17 |
| 18 // Padding used on the top and bottom edges of the cell. | 18 // Padding used on the top and bottom edges of the cell. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 - (instancetype)initWithFrame:(CGRect)frame { | 64 - (instancetype)initWithFrame:(CGRect)frame { |
| 65 self = [super initWithFrame:frame]; | 65 self = [super initWithFrame:frame]; |
| 66 if (self) { | 66 if (self) { |
| 67 self.isAccessibilityElement = YES; | 67 self.isAccessibilityElement = YES; |
| 68 | 68 |
| 69 _textLabel = [[UILabel alloc] init]; | 69 _textLabel = [[UILabel alloc] init]; |
| 70 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; | 70 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; |
| 71 [self.contentView addSubview:_textLabel]; | 71 [self.contentView addSubview:_textLabel]; |
| 72 | 72 |
| 73 _textLabel.font = | 73 _textLabel.font = [MDCTypography body2Font]; |
| 74 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14]; | |
| 75 _textLabel.numberOfLines = 0; | 74 _textLabel.numberOfLines = 0; |
| 76 | 75 |
| 77 // Set up the constraints. | 76 // Set up the constraints. |
| 78 [NSLayoutConstraint activateConstraints:@[ | 77 [NSLayoutConstraint activateConstraints:@[ |
| 79 [_textLabel.leadingAnchor | 78 [_textLabel.leadingAnchor |
| 80 constraintEqualToAnchor:self.contentView.leadingAnchor | 79 constraintEqualToAnchor:self.contentView.leadingAnchor |
| 81 constant:kHorizontalPadding], | 80 constant:kHorizontalPadding], |
| 82 [_textLabel.trailingAnchor | 81 [_textLabel.trailingAnchor |
| 83 constraintEqualToAnchor:self.contentView.trailingAnchor | 82 constraintEqualToAnchor:self.contentView.trailingAnchor |
| 84 constant:-kHorizontalPadding], | 83 constant:-kHorizontalPadding], |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 [EncryptionCell defaultTextColorForEnabledState:YES]; | 126 [EncryptionCell defaultTextColorForEnabledState:YES]; |
| 128 } | 127 } |
| 129 | 128 |
| 130 #pragma mark - UIAccessibility | 129 #pragma mark - UIAccessibility |
| 131 | 130 |
| 132 - (NSString*)accessibilityLabel { | 131 - (NSString*)accessibilityLabel { |
| 133 return self.textLabel.text; | 132 return self.textLabel.text; |
| 134 } | 133 } |
| 135 | 134 |
| 136 @end | 135 @end |
| OLD | NEW |