Commit a8403516 authored by spqchan's avatar spqchan Committed by Commit bot

[Material][Mac] Set Incognito Omnibox Dropdown Icons to White

BUG=618763

Review-Url: https://codereview.chromium.org/2082723002
Cr-Commit-Position: refs/heads/master@{#402634}
parent 11291923
...@@ -43,12 +43,11 @@ const NSInteger kMiddleButtonNumber = 2; ...@@ -43,12 +43,11 @@ const NSInteger kMiddleButtonNumber = 2;
[[OmniboxPopupCellData alloc] [[OmniboxPopupCellData alloc]
initWithMatch:match initWithMatch:match
contentsOffset:contentsOffset contentsOffset:contentsOffset
image:popupView.ImageForMatch(match, NO) image:popupView.ImageForMatch(match)
answerImage:(match.answer ? answerImage : nil) answerImage:(match.answer ? answerImage : nil)
forDarkTheme:isDarkTheme]); forDarkTheme:isDarkTheme]);
if (isDarkTheme) { if (isDarkTheme)
[cellData setIncognitoImage:popupView.ImageForMatch(match, YES)]; [cellData setIncognitoImage:popupView.ImageForMatch(match)];
}
[array addObject:cellData]; [array addObject:cellData];
if (match.type == AutocompleteMatchType::SEARCH_SUGGEST_TAIL) { if (match.type == AutocompleteMatchType::SEARCH_SUGGEST_TAIL) {
max_match_contents_width = max_match_contents_width =
......
...@@ -53,8 +53,7 @@ class OmniboxPopupViewMac : public OmniboxPopupView, ...@@ -53,8 +53,7 @@ class OmniboxPopupViewMac : public OmniboxPopupView,
size_t row) override; size_t row) override;
// Returns the NSImage that should be used as an icon for the given match. // Returns the NSImage that should be used as an icon for the given match.
NSImage* ImageForMatch(const AutocompleteMatch& match, NSImage* ImageForMatch(const AutocompleteMatch& match) const;
BOOL ignore_dark_theme) const;
OmniboxPopupMatrix* matrix() { return matrix_; } OmniboxPopupMatrix* matrix() { return matrix_; }
......
...@@ -336,8 +336,8 @@ void OmniboxPopupViewMac::PositionPopup(const CGFloat matrixHeight) { ...@@ -336,8 +336,8 @@ void OmniboxPopupViewMac::PositionPopup(const CGFloat matrixHeight) {
} }
} }
NSImage* OmniboxPopupViewMac::ImageForMatch(const AutocompleteMatch& match, NSImage* OmniboxPopupViewMac::ImageForMatch(
BOOL ignore_dark_theme) const { const AutocompleteMatch& match) const {
gfx::Image image = model_->GetIconIfExtensionMatch(match); gfx::Image image = model_->GetIconIfExtensionMatch(match);
if (!image.IsEmpty()) if (!image.IsEmpty())
return image.AsNSImage(); return image.AsNSImage();
...@@ -348,7 +348,7 @@ NSImage* OmniboxPopupViewMac::ImageForMatch(const AutocompleteMatch& match, ...@@ -348,7 +348,7 @@ NSImage* OmniboxPopupViewMac::ImageForMatch(const AutocompleteMatch& match,
: AutocompleteMatch::TypeToIcon(match.type); : AutocompleteMatch::TypeToIcon(match.type);
return OmniboxViewMac::ImageForResource(resource_id); return OmniboxViewMac::ImageForResource(resource_id);
} }
bool is_dark_mode = !ignore_dark_theme && [matrix_ hasDarkTheme]; bool is_dark_mode = [matrix_ hasDarkTheme];
const SkColor icon_color = const SkColor icon_color =
is_dark_mode ? SkColorSetA(SK_ColorWHITE, 0xCC) : gfx::kChromeIconGrey; is_dark_mode ? SkColorSetA(SK_ColorWHITE, 0xCC) : gfx::kChromeIconGrey;
const gfx::VectorIconId vector_icon_id = const gfx::VectorIconId vector_icon_id =
......
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