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/native_app_item.h" | 5 #import "ios/chrome/browser/ui/settings/cells/native_app_item.h" |
6 | 6 |
7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" | 9 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
10 #include "ios/chrome/grit/ios_strings.h" | 10 #include "ios/chrome/grit/ios_strings.h" |
11 #import "ios/third_party/material_components_ios/src/components/Buttons/src/Mate
rialButtons.h" | 11 #import "ios/third_party/material_components_ios/src/components/Buttons/src/Mate
rialButtons.h" |
12 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" | 12 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" |
13 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 13 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
14 #include "ui/base/l10n/l10n_util_mac.h" | 14 #include "ui/base/l10n/l10n_util_mac.h" |
15 | 15 |
16 #if !defined(__has_feature) || !__has_feature(objc_arc) | 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
17 #error "This file requires ARC support." | 17 #error "This file requires ARC support." |
18 #endif | 18 #endif |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // Padding used on the leading and trailing edges of the cell. | 22 // Padding used on the leading and trailing edges of the cell. |
23 const CGFloat kHorizontalPadding = 16; | 23 const CGFloat kHorizontalPadding = 16; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 _iconImageView.layer.cornerRadius = kIconCornerRadius; | 81 _iconImageView.layer.cornerRadius = kIconCornerRadius; |
82 _iconImageView.layer.masksToBounds = YES; | 82 _iconImageView.layer.masksToBounds = YES; |
83 self.layer.shouldRasterize = YES; | 83 self.layer.shouldRasterize = YES; |
84 self.layer.rasterizationScale = [[UIScreen mainScreen] scale]; | 84 self.layer.rasterizationScale = [[UIScreen mainScreen] scale]; |
85 [contentView addSubview:_iconImageView]; | 85 [contentView addSubview:_iconImageView]; |
86 | 86 |
87 _nameLabel = [[UILabel alloc] init]; | 87 _nameLabel = [[UILabel alloc] init]; |
88 _nameLabel.translatesAutoresizingMaskIntoConstraints = NO; | 88 _nameLabel.translatesAutoresizingMaskIntoConstraints = NO; |
89 [contentView addSubview:_nameLabel]; | 89 [contentView addSubview:_nameLabel]; |
90 | 90 |
91 _nameLabel.font = | 91 _nameLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14]; |
92 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14]; | |
93 _nameLabel.textColor = [[MDCPalette greyPalette] tint900]; | 92 _nameLabel.textColor = [[MDCPalette greyPalette] tint900]; |
94 | 93 |
95 _switchControl = [[UISwitch alloc] init]; | 94 _switchControl = [[UISwitch alloc] init]; |
96 _switchControl.onTintColor = [[MDCPalette cr_bluePalette] tint500]; | 95 _switchControl.onTintColor = [[MDCPalette cr_bluePalette] tint500]; |
97 | 96 |
98 _installButton = [[MDCFlatButton alloc] init]; | 97 _installButton = [[MDCFlatButton alloc] init]; |
99 _installButton.translatesAutoresizingMaskIntoConstraints = NO; | 98 _installButton.translatesAutoresizingMaskIntoConstraints = NO; |
100 _installButton.customTitleColor = [[MDCPalette cr_bluePalette] tint500]; | 99 _installButton.customTitleColor = [[MDCPalette cr_bluePalette] tint500]; |
101 [_installButton | 100 [_installButton |
102 setTitle:l10n_util::GetNSString(IDS_IOS_GOOGLE_APPS_INSTALL_BUTTON) | 101 setTitle:l10n_util::GetNSString(IDS_IOS_GOOGLE_APPS_INSTALL_BUTTON) |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 l10n_util::GetNSString(IDS_IOS_SETTING_OFF)]; | 183 l10n_util::GetNSString(IDS_IOS_SETTING_OFF)]; |
185 } | 184 } |
186 } | 185 } |
187 | 186 |
188 return [NSString stringWithFormat:@"%@, %@", self.nameLabel.text, | 187 return [NSString stringWithFormat:@"%@, %@", self.nameLabel.text, |
189 l10n_util::GetNSString( | 188 l10n_util::GetNSString( |
190 IDS_IOS_GOOGLE_APPS_INSTALL_BUTTON)]; | 189 IDS_IOS_GOOGLE_APPS_INSTALL_BUTTON)]; |
191 } | 190 } |
192 | 191 |
193 @end | 192 @end |
OLD | NEW |