OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/history/tab_history_cell.h" | 5 #import "ios/chrome/browser/ui/history/tab_history_cell.h" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #include "ios/chrome/browser/ui/ui_util.h" | 8 #include "ios/chrome/browser/ui/ui_util.h" |
9 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 9 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
10 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 10 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
11 #include "ios/web/public/navigation_item.h" | 11 #include "ios/web/public/navigation_item.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 // Header horizontal layout inset. | 18 // Header horizontal layout inset. |
19 const CGFloat kHeaderHorizontalInset = 16; | 19 const CGFloat kHeaderHorizontalInset = 16; |
20 // Header vertical layout inset. | 20 // Header vertical layout inset. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 self = [super initWithCoder:coder]; | 58 self = [super initWithCoder:coder]; |
59 if (self) | 59 if (self) |
60 [self commonInitialization]; | 60 [self commonInitialization]; |
61 | 61 |
62 return self; | 62 return self; |
63 } | 63 } |
64 | 64 |
65 - (void)commonInitialization { | 65 - (void)commonInitialization { |
66 _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; | 66 _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
67 [_titleLabel setTextColor:UIColorFromRGB(kTitleTextRGB)]; | 67 [_titleLabel setTextColor:UIColorFromRGB(kTitleTextRGB)]; |
68 [_titleLabel | 68 [_titleLabel setFont:[[MDCTypography fontLoader] regularFontOfSize:16]]; |
69 setFont:[[MDFRobotoFontLoader sharedInstance] regularFontOfSize:16]]; | |
70 [[self contentView] addSubview:_titleLabel]; | 69 [[self contentView] addSubview:_titleLabel]; |
71 } | 70 } |
72 | 71 |
73 - (void)layoutSubviews { | 72 - (void)layoutSubviews { |
74 [super layoutSubviews]; | 73 [super layoutSubviews]; |
75 self.titleLabel.frame = | 74 self.titleLabel.frame = |
76 AlignRectOriginAndSizeToPixels(self.contentView.bounds); | 75 AlignRectOriginAndSizeToPixels(self.contentView.bounds); |
77 } | 76 } |
78 | 77 |
79 #pragma mark Accessors | 78 #pragma mark Accessors |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 149 |
151 - (instancetype)initWithFrame:(CGRect)frame { | 150 - (instancetype)initWithFrame:(CGRect)frame { |
152 self = [super initWithFrame:frame]; | 151 self = [super initWithFrame:frame]; |
153 if (self) | 152 if (self) |
154 self.backgroundColor = UIColorFromRGB(kFooterRGB); | 153 self.backgroundColor = UIColorFromRGB(kFooterRGB); |
155 | 154 |
156 return self; | 155 return self; |
157 } | 156 } |
158 | 157 |
159 @end | 158 @end |
OLD | NEW |