Commit aefab4cc authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Change the background color of the infobars

This CL changes the background color of the infobars to be more aligned
with the UI Refresh look.

Bug: 817753
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I06db3d63b619fc63bf381d936f4c59cab4afaa28
Reviewed-on: https://chromium-review.googlesource.com/1122860Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572129}
parent 895b2c54
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "ios/chrome/browser/procedural_block_types.h" #import "ios/chrome/browser/procedural_block_types.h"
#import "ios/chrome/browser/ui/autofill/save_card_infobar_view_delegate.h" #import "ios/chrome/browser/ui/autofill/save_card_infobar_view_delegate.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/infobars/infobar_constants.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h" #import "ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h"
#include "ios/chrome/browser/ui/ui_util.h" #include "ios/chrome/browser/ui/ui_util.h"
#import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/chrome/browser/ui/uikit_ui_util.h"
...@@ -191,7 +192,11 @@ UIFont* InfoBarMessageFont() { ...@@ -191,7 +192,11 @@ UIFont* InfoBarMessageFont() {
- (void)setupSubviews { - (void)setupSubviews {
[self setAccessibilityViewIsModal:YES]; [self setAccessibilityViewIsModal:YES];
[self setBackgroundColor:[UIColor whiteColor]]; if (IsUIRefreshPhase1Enabled()) {
self.backgroundColor = UIColorFromRGB(kInfobarBackgroundColor);
} else {
self.backgroundColor = [UIColor whiteColor];
}
id<LayoutGuideProvider> safeAreaLayoutGuide = id<LayoutGuideProvider> safeAreaLayoutGuide =
SafeAreaLayoutGuideForView(self); SafeAreaLayoutGuideForView(self);
......
...@@ -7,6 +7,8 @@ source_set("infobars") { ...@@ -7,6 +7,8 @@ source_set("infobars") {
sources = [ sources = [
"confirm_infobar_view.h", "confirm_infobar_view.h",
"confirm_infobar_view.mm", "confirm_infobar_view.mm",
"infobar_constants.h",
"infobar_constants.mm",
"infobar_view_sizing.h", "infobar_view_sizing.h",
"infobar_view_sizing_delegate.h", "infobar_view_sizing_delegate.h",
] ]
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/infobars/infobar_constants.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h" #import "ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h"
#include "ios/chrome/browser/ui/ui_util.h" #include "ios/chrome/browser/ui/ui_util.h"
#import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/chrome/browser/ui/uikit_ui_util.h"
...@@ -759,8 +760,11 @@ UIImage* InfoBarCloseImage() { ...@@ -759,8 +760,11 @@ UIImage* InfoBarCloseImage() {
} }
- (void)resetBackground { - (void)resetBackground {
UIColor* color = [UIColor whiteColor]; if (IsUIRefreshPhase1Enabled()) {
[self setBackgroundColor:color]; self.backgroundColor = UIColorFromRGB(kInfobarBackgroundColor);
} else {
self.backgroundColor = [UIColor whiteColor];
}
CGFloat shadowY = 0; CGFloat shadowY = 0;
shadowY = -[shadow_ image].size.height; // Shadow above the infobar. shadowY = -[shadow_ image].size.height; // Shadow above the infobar.
[shadow_ setFrame:CGRectMake(0, shadowY, self.bounds.size.width, [shadow_ setFrame:CGRectMake(0, shadowY, self.bounds.size.width,
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONSTANTS_H_
#define IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONSTANTS_H_
extern const int kInfobarBackgroundColor;
#endif // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONSTANTS_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/infobars/infobar_constants.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
const int kInfobarBackgroundColor = 0xfafafa;
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