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

Side by Side Diff: ios/chrome/browser/ui/settings/cells/passphrase_error_item.mm

Issue 2912863005: Use MDCTypography instead of MDFRobotoFontLoader directly. (Closed)
Patch Set: Tentative fix for ManualTextFramerTest Created 3 years, 6 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/settings/cells/passphrase_error_item.h" 5 #import "ios/chrome/browser/ui/settings/cells/passphrase_error_item.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" 9 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
10 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h" 10 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h"
11 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h" 11 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h"
12 12
13 #if !defined(__has_feature) || !__has_feature(objc_arc) 13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 #error "This file requires ARC support." 14 #error "This file requires ARC support."
15 #endif 15 #endif
16 16
17 namespace { 17 namespace {
18 // Padding used on the leading and trailing edges of the cell. 18 // Padding used on the leading and trailing edges of the cell.
19 const CGFloat kHorizontalPadding = 16; 19 const CGFloat kHorizontalPadding = 16;
20 } // namespace 20 } // namespace
21 21
(...skipping 25 matching lines...) Expand all
47 @synthesize textLabel = _textLabel; 47 @synthesize textLabel = _textLabel;
48 @synthesize errorImageView = _errorImageView; 48 @synthesize errorImageView = _errorImageView;
49 49
50 - (instancetype)initWithFrame:(CGRect)frame { 50 - (instancetype)initWithFrame:(CGRect)frame {
51 self = [super initWithFrame:frame]; 51 self = [super initWithFrame:frame];
52 if (self) { 52 if (self) {
53 UIView* contentView = self.contentView; 53 UIView* contentView = self.contentView;
54 54
55 _textLabel = [[UILabel alloc] init]; 55 _textLabel = [[UILabel alloc] init];
56 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; 56 _textLabel.translatesAutoresizingMaskIntoConstraints = NO;
57 _textLabel.font = 57 _textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14];
58 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14];
59 _textLabel.textColor = [[MDCPalette cr_redPalette] tint500]; 58 _textLabel.textColor = [[MDCPalette cr_redPalette] tint500];
60 [contentView addSubview:_textLabel]; 59 [contentView addSubview:_textLabel];
61 60
62 _errorImageView = [[UIImageView alloc] init]; 61 _errorImageView = [[UIImageView alloc] init];
63 _errorImageView.translatesAutoresizingMaskIntoConstraints = NO; 62 _errorImageView.translatesAutoresizingMaskIntoConstraints = NO;
64 _errorImageView.image = [UIImage imageNamed:@"encryption_error"]; 63 _errorImageView.image = [UIImage imageNamed:@"encryption_error"];
65 [contentView addSubview:_errorImageView]; 64 [contentView addSubview:_errorImageView];
66 65
67 // Set up the constraints. 66 // Set up the constraints.
68 [NSLayoutConstraint activateConstraints:@[ 67 [NSLayoutConstraint activateConstraints:@[
(...skipping 18 matching lines...) Expand all
87 } 86 }
88 return self; 87 return self;
89 } 88 }
90 89
91 - (void)prepareForReuse { 90 - (void)prepareForReuse {
92 [super prepareForReuse]; 91 [super prepareForReuse];
93 self.textLabel.text = nil; 92 self.textLabel.text = nil;
94 } 93 }
95 94
96 @end 95 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/settings/cells/native_app_item.mm ('k') | ios/chrome/browser/ui/settings/cells/password_details_item.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698