Commit e1a24b09 authored by stkhapugin@chromium.org's avatar stkhapugin@chromium.org Committed by Commit Bot

[iOS UI Refresh] Use proper colors for popup.

Use colors from the popup spec for the omnibox popup.

Bug: 821817
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ic90f502e54b4d338ebfbc4532e70467f890dac8a
Reviewed-on: https://chromium-review.googlesource.com/1111856Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570356}
parent 70bf4f39
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "components/omnibox/browser/autocomplete_match.h" #include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/suggestion_answer.h" #include "components/omnibox/browser/suggestion_answer.h"
#include "ios/chrome/browser/ui/omnibox/omnibox_util.h" #include "ios/chrome/browser/ui/omnibox/omnibox_util.h"
#import "ios/chrome/browser/ui/ui_util.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -20,14 +21,33 @@ ...@@ -20,14 +21,33 @@
namespace { namespace {
// The color of the main text of a suggest cell. // The color of the main text of a suggest cell.
UIColor* SuggestionTextColor() { UIColor* SuggestionTextColor() {
return [UIColor colorWithWhite:(51 / 255.0) alpha:1.0]; if (IsUIRefreshPhase1Enabled()) {
return [UIColor blackColor];
} else {
return [UIColor colorWithWhite:(51 / 255.0) alpha:1.0];
}
} }
// The color of the detail text of a suggest cell. // The color of the detail text of a suggest cell.
UIColor* SuggestionDetailTextColor() { UIColor* SuggestionDetailTextColor() {
return [UIColor colorWithRed:(85 / 255.0) if (IsUIRefreshPhase1Enabled()) {
green:(149 / 255.0) return [UIColor colorWithWhite:0 alpha:0.41];
blue:(254 / 255.0) } else {
alpha:1.0]; return [UIColor colorWithRed:(85 / 255.0)
green:(149 / 255.0)
blue:(254 / 255.0)
alpha:1.0];
}
}
// The color of the detail text of a suggest cell.
UIColor* SuggestionDetailTextColorIncognito() {
if (IsUIRefreshPhase1Enabled()) {
return [UIColor colorWithWhite:1 alpha:0.5];
} else {
return [UIColor colorWithRed:(85 / 255.0)
green:(149 / 255.0)
blue:(254 / 255.0)
alpha:1.0];
}
} }
// The color of the text in the portion of a search suggestion that matches the // The color of the text in the portion of a search suggestion that matches the
// omnibox input text. // omnibox input text.
...@@ -37,6 +57,7 @@ UIColor* DimColor() { ...@@ -37,6 +57,7 @@ UIColor* DimColor() {
UIColor* SuggestionTextColorIncognito() { UIColor* SuggestionTextColorIncognito() {
return [UIColor whiteColor]; return [UIColor whiteColor];
} }
UIColor* DimColorIncognito() { UIColor* DimColorIncognito() {
return [UIColor whiteColor]; return [UIColor whiteColor];
} }
...@@ -111,7 +132,9 @@ UIColor* DimColorIncognito() { ...@@ -111,7 +132,9 @@ UIColor* DimColorIncognito() {
suggestionDetailTextColor = suggestionDetailTextColor =
_incognito ? SuggestionTextColorIncognito() : SuggestionTextColor(); _incognito ? SuggestionTextColorIncognito() : SuggestionTextColor();
} else { } else {
suggestionDetailTextColor = SuggestionDetailTextColor(); suggestionDetailTextColor = _incognito
? SuggestionDetailTextColorIncognito()
: SuggestionDetailTextColor();
} }
DCHECK(suggestionDetailTextColor); DCHECK(suggestionDetailTextColor);
detailAttributedText = detailAttributedText =
......
...@@ -159,15 +159,22 @@ const CGFloat kAppendButtonSize = 48.0; ...@@ -159,15 +159,22 @@ const CGFloat kAppendButtonSize = 48.0;
? IDR_IOS_OMNIBOX_KEYBOARD_VIEW_APPEND_INCOGNITO ? IDR_IOS_OMNIBOX_KEYBOARD_VIEW_APPEND_INCOGNITO
: IDR_IOS_OMNIBOX_KEYBOARD_VIEW_APPEND; : IDR_IOS_OMNIBOX_KEYBOARD_VIEW_APPEND;
UIImage* appendImage = NativeReversableImage(appendResourceID, YES); UIImage* appendImage = NativeReversableImage(appendResourceID, YES);
if (IsUIRefreshPhase1Enabled()) {
appendImage =
[appendImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
_appendButton.tintColor = _incognito ? [UIColor colorWithWhite:1 alpha:0.5]
: [UIColor colorWithWhite:0 alpha:0.3];
} else {
int appendSelectedResourceID =
_incognito ? IDR_IOS_OMNIBOX_KEYBOARD_VIEW_APPEND_INCOGNITO_HIGHLIGHTED
: IDR_IOS_OMNIBOX_KEYBOARD_VIEW_APPEND_HIGHLIGHTED;
UIImage* appendImageSelected =
NativeReversableImage(appendSelectedResourceID, YES);
[_appendButton setImage:appendImageSelected
forState:UIControlStateHighlighted];
}
[_appendButton setImage:appendImage forState:UIControlStateNormal]; [_appendButton setImage:appendImage forState:UIControlStateNormal];
int appendSelectedResourceID =
_incognito ? IDR_IOS_OMNIBOX_KEYBOARD_VIEW_APPEND_INCOGNITO_HIGHLIGHTED
: IDR_IOS_OMNIBOX_KEYBOARD_VIEW_APPEND_HIGHLIGHTED;
UIImage* appendImageSelected =
NativeReversableImage(appendSelectedResourceID, YES);
[_appendButton setImage:appendImageSelected
forState:UIControlStateHighlighted];
} }
- (NSString*)accessibilityLabel { - (NSString*)accessibilityLabel {
......
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