Commit 60e867a2 authored by Ewann's avatar Ewann Committed by Chromium LUCI CQ

[iOS] Updates system colours to use google material colours

This CL replaces the existing system colours by Google material colours.

Bug: 1155472
Change-Id: Ia9c9e8f31d65fe1db70fd29ad94ca370d0aede07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595050Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarJavier Flores <javierrobles@chromium.org>
Commit-Queue: Ewann Pellé <ewannpv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840999}
parent 581180f8
...@@ -144,7 +144,8 @@ constexpr NSUInteger kUIViewAnimationCurveToOptionsShift = 16; ...@@ -144,7 +144,8 @@ constexpr NSUInteger kUIViewAnimationCurveToOptionsShift = 16;
self.contentView = [[UIView alloc] init]; self.contentView = [[UIView alloc] init];
self.contentView.accessibilityIdentifier = self.alertAccessibilityIdentifier; self.contentView.accessibilityIdentifier = self.alertAccessibilityIdentifier;
self.contentView.clipsToBounds = YES; self.contentView.clipsToBounds = YES;
self.contentView.backgroundColor = UIColor.cr_systemBackgroundColor; self.contentView.backgroundColor =
[UIColor colorNamed:kPrimaryBackgroundColor];
self.contentView.layer.cornerRadius = kCornerRadius; self.contentView.layer.cornerRadius = kCornerRadius;
self.contentView.layer.shadowOffset = self.contentView.layer.shadowOffset =
CGSizeMake(kShadowOffsetX, kShadowOffsetY); CGSizeMake(kShadowOffsetX, kShadowOffsetY);
...@@ -294,7 +295,8 @@ constexpr NSUInteger kUIViewAnimationCurveToOptionsShift = 16; ...@@ -294,7 +295,8 @@ constexpr NSUInteger kUIViewAnimationCurveToOptionsShift = 16;
} }
stackHolder.layer.borderWidth = 1.0 / [UIScreen mainScreen].scale; stackHolder.layer.borderWidth = 1.0 / [UIScreen mainScreen].scale;
stackHolder.clipsToBounds = YES; stackHolder.clipsToBounds = YES;
stackHolder.backgroundColor = UIColor.cr_secondarySystemBackgroundColor; stackHolder.backgroundColor =
[UIColor colorNamed:kSecondaryBackgroundColor];
stackHolder.translatesAutoresizingMaskIntoConstraints = NO; stackHolder.translatesAutoresizingMaskIntoConstraints = NO;
self.textFieldStackHolder = stackHolder; self.textFieldStackHolder = stackHolder;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#import "ios/chrome/browser/ui/authentication/signin/user_signin/gradient_view.h" #import "ios/chrome/browser/ui/authentication/signin/user_signin/gradient_view.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -53,8 +53,9 @@ ...@@ -53,8 +53,9 @@
[CATransaction setDisableActions:YES]; [CATransaction setDisableActions:YES];
self.gradientLayer.colors = @[ self.gradientLayer.colors = @[
(id)[UIColor.cr_systemBackgroundColor colorWithAlphaComponent:0].CGColor, (id)[[UIColor colorNamed:kPrimaryBackgroundColor] colorWithAlphaComponent:0]
(id)UIColor.cr_systemBackgroundColor.CGColor, .CGColor,
(id)[UIColor colorNamed:kPrimaryBackgroundColor].CGColor,
]; ];
[CATransaction commit]; [CATransaction commit];
} }
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#import "ios/chrome/browser/ui/authentication/signin/user_signin/gradient_view.h" #import "ios/chrome/browser/ui/authentication/signin/user_signin/gradient_view.h"
#import "ios/chrome/browser/ui/util/rtl_geometry.h" #import "ios/chrome/browser/ui/util/rtl_geometry.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#import "ios/chrome/common/ui/util/constraints_ui_util.h" #import "ios/chrome/common/ui/util/constraints_ui_util.h"
#import "ios/chrome/common/ui/util/pointer_interaction_util.h" #import "ios/chrome/common/ui/util/pointer_interaction_util.h"
...@@ -307,7 +306,7 @@ enum AuthenticationButtonType { ...@@ -307,7 +306,7 @@ enum AuthenticationButtonType {
#pragma mark - Properties #pragma mark - Properties
- (UIColor*)systemBackgroundColor { - (UIColor*)systemBackgroundColor {
return UIColor.cr_systemBackgroundColor; return [UIColor colorNamed:kPrimaryBackgroundColor];
} }
- (NSString*)confirmationButtonTitle { - (NSString*)confirmationButtonTitle {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#import "ios/chrome/browser/ui/authentication/unified_consent/unified_consent_constants.h" #import "ios/chrome/browser/ui/authentication/unified_consent/unified_consent_constants.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
#import "ios/chrome/common/ui/util/constraints_ui_util.h" #import "ios/chrome/common/ui/util/constraints_ui_util.h"
#import "ios/chrome/common/ui/util/pointer_interaction_util.h" #import "ios/chrome/common/ui/util/pointer_interaction_util.h"
...@@ -47,7 +48,7 @@ const CGFloat kArrowDownMargin = 12.; ...@@ -47,7 +48,7 @@ const CGFloat kArrowDownMargin = 12.;
if (self) { if (self) {
self.accessibilityIdentifier = kIdentityPickerViewIdentifier; self.accessibilityIdentifier = kIdentityPickerViewIdentifier;
self.layer.cornerRadius = kIdentityPickerViewRadius; self.layer.cornerRadius = kIdentityPickerViewRadius;
self.backgroundColor = UIColor.cr_secondarySystemBackgroundColor; self.backgroundColor = [UIColor colorNamed:kSecondaryBackgroundColor];
// Adding view elements inside. // Adding view elements inside.
// Ink view. // Ink view.
_rippleView = [[MDCRippleView alloc] initWithFrame:CGRectZero]; _rippleView = [[MDCRippleView alloc] initWithFrame:CGRectZero];
......
...@@ -193,7 +193,7 @@ const char* const kSettingsSyncURL = "internal://settings-sync"; ...@@ -193,7 +193,7 @@ const char* const kSettingsSyncURL = "internal://settings-sync";
// Separator. // Separator.
UIView* separator = [[UIView alloc] initWithFrame:CGRectZero]; UIView* separator = [[UIView alloc] initWithFrame:CGRectZero];
separator.translatesAutoresizingMaskIntoConstraints = NO; separator.translatesAutoresizingMaskIntoConstraints = NO;
separator.backgroundColor = UIColor.cr_secondarySystemBackgroundColor; separator.backgroundColor = [UIColor colorNamed:kSecondaryBackgroundColor];
[container addSubview:separator]; [container addSubview:separator];
// Customize label. // Customize label.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#import "ios/chrome/browser/ui/bookmarks/bookmark_ui_constants.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_ui_constants.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = UIColor.cr_systemBackgroundColor; self.view.backgroundColor = [UIColor colorNamed:kPrimaryBackgroundColor];
self.navigationBar.accessibilityIdentifier = kBookmarkNavigationBarIdentifier; self.navigationBar.accessibilityIdentifier = kBookmarkNavigationBarIdentifier;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h" #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#import "ios/chrome/browser/ui/material_components/chrome_app_bar_view_controller.h" #import "ios/chrome/browser/ui/material_components/chrome_app_bar_view_controller.h"
#import "ios/chrome/browser/ui/material_components/utils.h" #import "ios/chrome/browser/ui/material_components/utils.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -65,9 +65,10 @@ ...@@ -65,9 +65,10 @@
} }
// Suport dark mode. // Suport dark mode.
self.collectionView.backgroundColor = UIColor.cr_systemGroupedBackgroundColor; self.collectionView.backgroundColor =
[UIColor colorNamed:kGroupedPrimaryBackgroundColor];
self.styler.cellBackgroundColor = self.styler.cellBackgroundColor =
UIColor.cr_secondarySystemGroupedBackgroundColor; [UIColor colorNamed:kGroupedSecondaryBackgroundColor];
} }
- (void)contentSizeCategoryDidChange:(id)sender { - (void)contentSizeCategoryDidChange:(id)sender {
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#import "ios/chrome/browser/ui/fancy_ui/primary_action_button.h" #import "ios/chrome/browser/ui/fancy_ui/primary_action_button.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#import "ios/chrome/common/ui/util/pointer_interaction_util.h" #import "ios/chrome/common/ui/util/pointer_interaction_util.h"
...@@ -43,7 +42,7 @@ ...@@ -43,7 +42,7 @@
} }
#endif // defined(__IPHONE_13_4) #endif // defined(__IPHONE_13_4)
UIColor* hintColor = UIColor.cr_systemBackgroundColor; UIColor* hintColor = [UIColor colorNamed:kPrimaryBackgroundColor];
UIColor* inkColor = [UIColor colorWithWhite:1 alpha:0.2f]; UIColor* inkColor = [UIColor colorWithWhite:1 alpha:0.2f];
UIColor* backgroundColor = [UIColor colorNamed:kBlueColor]; UIColor* backgroundColor = [UIColor colorNamed:kBlueColor];
UIColor* disabledColor = [UIColor colorNamed:kDisabledTintColor]; UIColor* disabledColor = [UIColor colorNamed:kDisabledTintColor];
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#import "ios/chrome/browser/ui/icons/chrome_icon.h" #import "ios/chrome/browser/ui/icons/chrome_icon.h"
#import "ios/chrome/browser/ui/material_components/utils.h" #import "ios/chrome/browser/ui/material_components/utils.h"
#include "ios/chrome/browser/ui/util/rtl_geometry.h" #include "ios/chrome/browser/ui/util/rtl_geometry.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#import "ios/web/common/web_view_creation_util.h" #import "ios/web/common/web_view_creation_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:60.0]; timeoutInterval:60.0];
[_webView loadRequest:request]; [_webView loadRequest:request];
[_webView setBackgroundColor:UIColor.cr_systemBackgroundColor]; [_webView setBackgroundColor:[UIColor colorNamed:kPrimaryBackgroundColor]];
[self.view addSubview:_webView]; [self.view addSubview:_webView];
ConfigureAppBarViewControllerWithCardStyle(_appBarViewController); ConfigureAppBarViewControllerWithCardStyle(_appBarViewController);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -44,7 +45,7 @@ void ConfigureAppBarViewControllerWithCardStyle( ...@@ -44,7 +45,7 @@ void ConfigureAppBarViewControllerWithCardStyle(
viewController.headerView.shiftBehavior = viewController.headerView.shiftBehavior =
MDCFlexibleHeaderShiftBehaviorDisabled; MDCFlexibleHeaderShiftBehaviorDisabled;
viewController.headerView.backgroundColor = viewController.headerView.backgroundColor =
UIColor.cr_secondarySystemBackgroundColor; [UIColor colorNamed:kSecondaryBackgroundColor];
viewController.navigationBar.tintColor = UIColor.cr_labelColor; viewController.navigationBar.tintColor = UIColor.cr_labelColor;
viewController.navigationBar.titleAlignment = viewController.navigationBar.titleAlignment =
MDCNavigationBarTitleAlignmentLeading; MDCNavigationBarTitleAlignmentLeading;
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "ios/chrome/browser/ui/table_view/cells/table_view_url_item.h" #include "ios/chrome/browser/ui/table_view/cells/table_view_url_item.h"
#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h" #import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -82,8 +81,9 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -82,8 +81,9 @@ typedef NS_ENUM(NSInteger, ItemType) {
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = UIColor.cr_systemBackgroundColor; self.view.backgroundColor = [UIColor colorNamed:kPrimaryBackgroundColor];
self.styler.cellBackgroundColor = UIColor.cr_systemBackgroundColor; self.styler.cellBackgroundColor =
[UIColor colorNamed:kPrimaryBackgroundColor];
self.tableView.sectionHeaderHeight = 0; self.tableView.sectionHeaderHeight = 0;
self.tableView.sectionFooterHeight = 0; self.tableView.sectionFooterHeight = 0;
[self.tableView [self.tableView
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h" #import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h"
#import "ios/chrome/browser/ui/table_view/table_view_utils.h" #import "ios/chrome/browser/ui/table_view/table_view_utils.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
...@@ -88,7 +87,8 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -88,7 +87,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = UIColor.cr_systemGroupedBackgroundColor; self.view.backgroundColor =
[UIColor colorNamed:kGroupedPrimaryBackgroundColor];
self.tableView.accessibilityIdentifier = kAddCreditCardViewID; self.tableView.accessibilityIdentifier = kAddCreditCardViewID;
self.navigationItem.title = l10n_util::GetNSString( self.navigationItem.title = l10n_util::GetNSString(
......
...@@ -139,10 +139,10 @@ ...@@ -139,10 +139,10 @@
if (!base::FeatureList::IsEnabled(kSettingsRefresh)) { if (!base::FeatureList::IsEnabled(kSettingsRefresh)) {
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.styler.cellBackgroundColor = UIColor.cr_systemBackgroundColor;
self.styler.tableViewBackgroundColor = UIColor.cr_systemBackgroundColor;
self.tableView.accessibilityIdentifier = self.tableView.accessibilityIdentifier =
kClearBrowsingDataViewAccessibilityIdentifier; kClearBrowsingDataViewAccessibilityIdentifier;
self.styler.tableViewBackgroundColor =
[UIColor colorNamed:kPrimaryBackgroundColor];
self.tableView.backgroundColor = self.styler.tableViewBackgroundColor; self.tableView.backgroundColor = self.styler.tableViewBackgroundColor;
// TableView configuration // TableView configuration
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#import "ios/chrome/browser/ui/table_view/table_view_utils.h" #import "ios/chrome/browser/ui/table_view/table_view_utils.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
...@@ -78,7 +79,8 @@ static_assert( ...@@ -78,7 +79,8 @@ static_assert(
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
if (!base::FeatureList::IsEnabled(kSettingsRefresh)) { if (!base::FeatureList::IsEnabled(kSettingsRefresh)) {
self.styler.tableViewBackgroundColor = UIColor.cr_systemBackgroundColor; self.styler.tableViewBackgroundColor =
[UIColor colorNamed:kPrimaryBackgroundColor];
self.tableView.backgroundColor = self.styler.tableViewBackgroundColor; self.tableView.backgroundColor = self.styler.tableViewBackgroundColor;
} }
[self loadModel]; [self loadModel];
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/chrome/browser/ui/util/ui_util.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#import "ios/chrome/common/ui/util/constraints_ui_util.h" #import "ios/chrome/common/ui/util/constraints_ui_util.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
...@@ -289,7 +288,7 @@ NSString* const kSettingsDoneButtonId = @"kSettingsDoneButtonId"; ...@@ -289,7 +288,7 @@ NSString* const kSettingsDoneButtonId = @"kSettingsDoneButtonId";
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = UIColor.cr_systemBackgroundColor; self.view.backgroundColor = [UIColor colorNamed:kPrimaryBackgroundColor];
if (base::FeatureList::IsEnabled(kSettingsRefresh)) { if (base::FeatureList::IsEnabled(kSettingsRefresh)) {
self.navigationBar.translucent = NO; self.navigationBar.translucent = NO;
......
...@@ -117,7 +117,7 @@ const CGFloat kActivityIndicatorDimensionIPhone = 56; ...@@ -117,7 +117,7 @@ const CGFloat kActivityIndicatorDimensionIPhone = 56;
- (void)viewDidLoad { - (void)viewDidLoad {
if (!base::FeatureList::IsEnabled(kSettingsRefresh)) { if (!base::FeatureList::IsEnabled(kSettingsRefresh)) {
self.styler.tableViewBackgroundColor = self.styler.tableViewBackgroundColor =
UIColor.cr_systemGroupedBackgroundColor; [UIColor colorNamed:kGroupedPrimaryBackgroundColor];
} }
UIBarButtonItem* flexibleSpace = [[UIBarButtonItem alloc] UIBarButtonItem* flexibleSpace = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
...@@ -128,7 +128,7 @@ const CGFloat kActivityIndicatorDimensionIPhone = 56; ...@@ -128,7 +128,7 @@ const CGFloat kActivityIndicatorDimensionIPhone = 56;
[super viewDidLoad]; [super viewDidLoad];
self.styler.cellBackgroundColor = self.styler.cellBackgroundColor =
UIColor.cr_secondarySystemGroupedBackgroundColor; [UIColor colorNamed:kGroupedSecondaryBackgroundColor];
self.styler.cellTitleColor = UIColor.cr_labelColor; self.styler.cellTitleColor = UIColor.cr_labelColor;
self.tableView.estimatedSectionHeaderHeight = kEstimatedHeaderFooterHeight; self.tableView.estimatedSectionHeaderHeight = kEstimatedHeaderFooterHeight;
self.tableView.estimatedRowHeight = kSettingsCellDefaultHeight; self.tableView.estimatedRowHeight = kSettingsCellDefaultHeight;
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -20,9 +19,10 @@ ...@@ -20,9 +19,10 @@
if (base::FeatureList::IsEnabled(kSettingsRefresh)) { if (base::FeatureList::IsEnabled(kSettingsRefresh)) {
_tableViewBackgroundColor = _tableViewBackgroundColor =
[UIColor colorNamed:kSecondaryBackgroundColor]; [UIColor colorNamed:kSecondaryBackgroundColor];
_cellBackgroundColor = UIColor.cr_secondarySystemGroupedBackgroundColor; _cellBackgroundColor =
[UIColor colorNamed:kGroupedSecondaryBackgroundColor];
} else { } else {
_tableViewBackgroundColor = UIColor.cr_systemBackgroundColor; _tableViewBackgroundColor = [UIColor colorNamed:kPrimaryBackgroundColor];
} }
} }
return self; return self;
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h" #import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h"
#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h" #import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -43,9 +42,10 @@ ...@@ -43,9 +42,10 @@
self.toolbar.barTintColor = [UIColor colorNamed:kSecondaryBackgroundColor]; self.toolbar.barTintColor = [UIColor colorNamed:kSecondaryBackgroundColor];
self.view.backgroundColor = [UIColor colorNamed:kSecondaryBackgroundColor]; self.view.backgroundColor = [UIColor colorNamed:kSecondaryBackgroundColor];
} else { } else {
self.navigationBar.barTintColor = UIColor.cr_systemBackgroundColor; self.navigationBar.barTintColor =
self.toolbar.barTintColor = UIColor.cr_systemBackgroundColor; [UIColor colorNamed:kPrimaryBackgroundColor];
self.view.backgroundColor = UIColor.cr_systemBackgroundColor; self.toolbar.barTintColor = [UIColor colorNamed:kPrimaryBackgroundColor];
self.view.backgroundColor = [UIColor colorNamed:kPrimaryBackgroundColor];
} }
} }
......
...@@ -13,16 +13,6 @@ ...@@ -13,16 +13,6 @@
// TODO (crbug.com/981889): Remove along with iOS 12. // TODO (crbug.com/981889): Remove along with iOS 12.
@interface UIColor (CRSemanticColors) @interface UIColor (CRSemanticColors)
// System Background Color
@property(class, nonatomic, readonly) UIColor* cr_systemBackgroundColor;
@property(class, nonatomic, readonly)
UIColor* cr_secondarySystemBackgroundColor;
// System Grouped Background Colors
@property(class, nonatomic, readonly) UIColor* cr_systemGroupedBackgroundColor;
@property(class, nonatomic, readonly)
UIColor* cr_secondarySystemGroupedBackgroundColor;
// Label Colors // Label Colors
@property(class, nonatomic, readonly) UIColor* cr_labelColor; @property(class, nonatomic, readonly) UIColor* cr_labelColor;
@property(class, nonatomic, readonly) UIColor* cr_secondaryLabelColor; @property(class, nonatomic, readonly) UIColor* cr_secondaryLabelColor;
......
...@@ -10,42 +10,6 @@ ...@@ -10,42 +10,6 @@
@implementation UIColor (CRSemanticColors) @implementation UIColor (CRSemanticColors)
#pragma mark - System Background Colors
+ (UIColor*)cr_systemBackgroundColor {
if (@available(iOS 13, *)) {
return UIColor.systemBackgroundColor;
}
return UIColor.whiteColor;
}
+ (UIColor*)cr_secondarySystemBackgroundColor {
if (@available(iOS 13, *)) {
return UIColor.secondarySystemBackgroundColor;
}
// This is the value for secondarySystemBackgroundColor in light mode.
return [UIColor colorWithRed:244 / (CGFloat)0xFF
green:244 / (CGFloat)0xFF
blue:248 / (CGFloat)0xFF
alpha:1];
}
#pragma mark - System Grouped Background Colors
+ (UIColor*)cr_systemGroupedBackgroundColor {
if (@available(iOS 13, *)) {
return UIColor.systemGroupedBackgroundColor;
}
return UIColor.groupTableViewBackgroundColor;
}
+ (UIColor*)cr_secondarySystemGroupedBackgroundColor {
if (@available(iOS 13, *)) {
return UIColor.secondarySystemGroupedBackgroundColor;
}
return UIColor.whiteColor;
}
#pragma mark - Label Colors #pragma mark - Label Colors
+ (UIColor*)cr_labelColor { + (UIColor*)cr_labelColor {
......
...@@ -27,9 +27,12 @@ group("resources") { ...@@ -27,9 +27,12 @@ group("resources") {
":grey_700_color", ":grey_700_color",
":grey_800_color", ":grey_800_color",
":grey_900_color", ":grey_900_color",
":grouped_primary_background_color",
":grouped_secondary_background_color",
":mdc_ink_color", ":mdc_ink_color",
":mdc_secondary_ink_color", ":mdc_secondary_ink_color",
":placeholder_image_tint_color", ":placeholder_image_tint_color",
":primary_background_color",
":red_color", ":red_color",
":red_dark_color", ":red_dark_color",
":scrim_background_color", ":scrim_background_color",
...@@ -223,3 +226,15 @@ colorset("toolbar_shadow_color") { ...@@ -223,3 +226,15 @@ colorset("toolbar_shadow_color") {
colorset("secondary_background_color") { colorset("secondary_background_color") {
sources = [ "secondary_background_color.colorset/Contents.json" ] sources = [ "secondary_background_color.colorset/Contents.json" ]
} }
colorset("primary_background_color") {
sources = [ "primary_background_color.colorset/Contents.json" ]
}
colorset("grouped_secondary_background_color") {
sources = [ "grouped_secondary_background_color.colorset/Contents.json" ]
}
colorset("grouped_primary_background_color") {
sources = [ "grouped_primary_background_color.colorset/Contents.json" ]
}
{
"info": {
"version": 1,
"author": "xcode"
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "display-p3",
"components": {
"red": "0xF1",
"alpha": "1.000",
"blue": "0xF4",
"green": "0xF3"
}
}
},
{
"idiom": "universal",
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "display-p3",
"components": {
"red": "0x20",
"alpha": "1.000",
"blue": "0x24",
"green": "0x21"
}
}
}
]
}
\ No newline at end of file
{
"info": {
"version": 1,
"author": "xcode"
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "display-p3",
"components": {
"red": "0xFF",
"alpha": "1.000",
"blue": "0xFF",
"green": "0xFF"
}
}
},
{
"idiom": "universal",
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "display-p3",
"components": {
"red": "0x35",
"alpha": "1.000",
"blue": "0x39",
"green": "0x37"
}
}
}
]
}
\ No newline at end of file
{
"info": {
"version": 1,
"author": "xcode"
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "display-p3",
"components": {
"red": "0xFF",
"alpha": "1.000",
"blue": "0xFF",
"green": "0xFF"
}
}
},
{
"idiom": "universal",
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "display-p3",
"components": {
"red": "0x20",
"alpha": "1.000",
"blue": "0x24",
"green": "0x21"
}
}
}
]
}
\ No newline at end of file
...@@ -14,6 +14,10 @@ extern NSString* const kCloseButtonColor; ...@@ -14,6 +14,10 @@ extern NSString* const kCloseButtonColor;
extern NSString* const kDisabledTintColor; extern NSString* const kDisabledTintColor;
// Background color used in the rounded squares behind favicons. // Background color used in the rounded squares behind favicons.
extern NSString* const kFaviconBackgroundColor; extern NSString* const kFaviconBackgroundColor;
// Primary grouped background color.
extern NSString* const kGroupedPrimaryBackgroundColor;
// Secondary grouped background color.
extern NSString* const kGroupedSecondaryBackgroundColor;
// Ink color for an MDC button. // Ink color for an MDC button.
extern NSString* const kMDCInkColor; extern NSString* const kMDCInkColor;
// Ink color for a secondary style MDC button (button with transparent // Ink color for a secondary style MDC button (button with transparent
...@@ -21,6 +25,8 @@ extern NSString* const kMDCInkColor; ...@@ -21,6 +25,8 @@ extern NSString* const kMDCInkColor;
extern NSString* const kMDCSecondaryInkColor; extern NSString* const kMDCSecondaryInkColor;
// Color used to tint placeholder images and icons. // Color used to tint placeholder images and icons.
extern NSString* const kPlaceholderImageTintColor; extern NSString* const kPlaceholderImageTintColor;
// Primary background color.
extern NSString* const kPrimaryBackgroundColor;
extern NSString* const kScrimBackgroundColor; extern NSString* const kScrimBackgroundColor;
// Secondary background color. // Secondary background color.
extern NSString* const kSecondaryBackgroundColor; extern NSString* const kSecondaryBackgroundColor;
......
...@@ -13,9 +13,14 @@ NSString* const kBackgroundColor = @"background_color"; ...@@ -13,9 +13,14 @@ NSString* const kBackgroundColor = @"background_color";
NSString* const kCloseButtonColor = @"close_button_color"; NSString* const kCloseButtonColor = @"close_button_color";
NSString* const kDisabledTintColor = @"disabled_tint_color"; NSString* const kDisabledTintColor = @"disabled_tint_color";
NSString* const kFaviconBackgroundColor = @"favicon_background_color"; NSString* const kFaviconBackgroundColor = @"favicon_background_color";
NSString* const kGroupedPrimaryBackgroundColor =
@"grouped_primary_background_color";
NSString* const kGroupedSecondaryBackgroundColor =
@"grouped_secondary_background_color";
NSString* const kMDCInkColor = @"mdc_ink_color"; NSString* const kMDCInkColor = @"mdc_ink_color";
NSString* const kMDCSecondaryInkColor = @"mdc_secondary_ink_color"; NSString* const kMDCSecondaryInkColor = @"mdc_secondary_ink_color";
NSString* const kPlaceholderImageTintColor = @"placeholder_image_tint_color"; NSString* const kPlaceholderImageTintColor = @"placeholder_image_tint_color";
NSString* const kPrimaryBackgroundColor = @"primary_background_color";
NSString* const kScrimBackgroundColor = @"scrim_background_color"; NSString* const kScrimBackgroundColor = @"scrim_background_color";
NSString* const kSecondaryBackgroundColor = @"secondary_background_color"; NSString* const kSecondaryBackgroundColor = @"secondary_background_color";
NSString* const kSeparatorColor = @"separator_color"; NSString* const kSeparatorColor = @"separator_color";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment