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

Side by Side Diff: ios/chrome/browser/ui/bookmarks/bookmark_promo_cell.mm

Issue 2912863005: Use MDCTypography instead of MDFRobotoFontLoader directly. (Closed)
Patch Set: Revert main_controller 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 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/bookmarks/bookmark_promo_cell.h" 5 #import "ios/chrome/browser/ui/bookmarks/bookmark_promo_cell.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" 11 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
12 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" 12 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
13 #import "ios/chrome/browser/ui/rtl_geometry.h" 13 #import "ios/chrome/browser/ui/rtl_geometry.h"
14 #import "ios/chrome/browser/ui/uikit_ui_util.h" 14 #import "ios/chrome/browser/ui/uikit_ui_util.h"
15 #include "ios/chrome/grit/ios_chromium_strings.h" 15 #include "ios/chrome/grit/ios_chromium_strings.h"
16 #include "ios/chrome/grit/ios_strings.h" 16 #include "ios/chrome/grit/ios_strings.h"
17 #import "ios/third_party/material_components_ios/src/components/Buttons/src/Mate rialButtons.h" 17 #import "ios/third_party/material_components_ios/src/components/Buttons/src/Mate rialButtons.h"
18 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h" 18 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h"
19 #import "ui/base/l10n/l10n_util_mac.h" 19 #import "ui/base/l10n/l10n_util_mac.h"
20 20
21 #if !defined(__has_feature) || !__has_feature(objc_arc) 21 #if !defined(__has_feature) || !__has_feature(objc_arc)
22 #error "This file requires ARC support." 22 #error "This file requires ARC support."
23 #endif 23 #endif
24 24
25 namespace { 25 namespace {
26 26
27 const CGFloat kPadding = 16; 27 const CGFloat kPadding = 16;
28 const CGFloat kButtonHeight = 36; 28 const CGFloat kButtonHeight = 36;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 - (instancetype)initWithFrame:(CGRect)frame { 69 - (instancetype)initWithFrame:(CGRect)frame {
70 self = [super initWithFrame:frame]; 70 self = [super initWithFrame:frame];
71 if (self) { 71 if (self) {
72 self.backgroundColor = [UIColor whiteColor]; 72 self.backgroundColor = [UIColor whiteColor];
73 self.accessibilityIdentifier = @"promo_view"; 73 self.accessibilityIdentifier = @"promo_view";
74 74
75 // The title. 75 // The title.
76 UILabel* titleLabel = [[UILabel alloc] init]; 76 UILabel* titleLabel = [[UILabel alloc] init];
77 _titleLabel = titleLabel; 77 _titleLabel = titleLabel;
78 _titleLabel.textColor = bookmark_utils_ios::darkTextColor(); 78 _titleLabel.textColor = bookmark_utils_ios::darkTextColor();
79 _titleLabel.font = 79 _titleLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:16];
80 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:16];
81 _titleLabel.numberOfLines = 0; 80 _titleLabel.numberOfLines = 0;
82 SetTextWithLineHeight(_titleLabel, 81 SetTextWithLineHeight(_titleLabel,
83 l10n_util::GetNSString(IDS_IOS_BOOKMARK_PROMO_TITLE), 82 l10n_util::GetNSString(IDS_IOS_BOOKMARK_PROMO_TITLE),
84 20.f); 83 20.f);
85 _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; 84 _titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
86 [self addSubview:_titleLabel]; 85 [self addSubview:_titleLabel];
87 86
88 // The subtitle. 87 // The subtitle.
89 UILabel* subtitleLabel = [[UILabel alloc] init]; 88 UILabel* subtitleLabel = [[UILabel alloc] init];
90 _subtitleLabel = subtitleLabel; 89 _subtitleLabel = subtitleLabel;
91 _subtitleLabel.textColor = bookmark_utils_ios::darkTextColor(); 90 _subtitleLabel.textColor = bookmark_utils_ios::darkTextColor();
92 _subtitleLabel.font = 91 _subtitleLabel.font = [MDCTypography body1Font];
sdefresne 2017/05/30 09:23:36 Why change some calls like "[[MDFRobotoFontLoader
93 [[MDFRobotoFontLoader sharedInstance] regularFontOfSize:14];
94 _subtitleLabel.numberOfLines = 0; 92 _subtitleLabel.numberOfLines = 0;
95 SetTextWithLineHeight( 93 SetTextWithLineHeight(
96 _subtitleLabel, l10n_util::GetNSString(IDS_IOS_BOOKMARK_PROMO_MESSAGE), 94 _subtitleLabel, l10n_util::GetNSString(IDS_IOS_BOOKMARK_PROMO_MESSAGE),
97 20.f); 95 20.f);
98 _subtitleLabel.translatesAutoresizingMaskIntoConstraints = NO; 96 _subtitleLabel.translatesAutoresizingMaskIntoConstraints = NO;
99 [self addSubview:_subtitleLabel]; 97 [self addSubview:_subtitleLabel];
100 98
101 // The sign-in button. 99 // The sign-in button.
102 MDCFlatButton* signInButton = [[MDCFlatButton alloc] init]; 100 MDCFlatButton* signInButton = [[MDCFlatButton alloc] init];
103 _signInButton = signInButton; 101 _signInButton = signInButton;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 286
289 - (void)signIn:(id)sender { 287 - (void)signIn:(id)sender {
290 [self.delegate bookmarkPromoCellDidTapSignIn:self]; 288 [self.delegate bookmarkPromoCellDidTapSignIn:self];
291 } 289 }
292 290
293 - (void)dismiss:(id)sender { 291 - (void)dismiss:(id)sender {
294 [self.delegate bookmarkPromoCellDidTapDismiss:self]; 292 [self.delegate bookmarkPromoCellDidTapDismiss:self];
295 } 293 }
296 294
297 @end 295 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698