Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 2104623002: [Material][Mac] Update the incognito vector icon color to white (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index e035c0a383ad7995135c04aa21c7ecc16ff610f8..41e190060eda3e854d075feaf99a398783ea383b 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -88,7 +88,7 @@ const int kDefaultIconSize = 16;
// Color of the vector graphic icons when the location bar is dark.
// SkColorSetARGB(0xCC, 0xFF, 0xFF 0xFF);
-const SkColor kMaterialDarkVectorIconColor = 0xCCFFFFFF;
+const SkColor kMaterialDarkVectorIconColor = SK_ColorWHITE;
} // namespace
@@ -721,18 +721,27 @@ void LocationBarViewMac::UpdateLocationIcon() {
gfx::VectorIconId vector_icon_id = gfx::VectorIconId::VECTOR_ICON_NONE;
if (ShouldShowEVBubble()) {
vector_icon_id = gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID;
- vector_icon_color = in_dark_mode
- ? kMaterialDarkVectorIconColor
- : gfx::kGoogleGreen700;
+ vector_icon_color = gfx::kGoogleGreen700;
} else {
- vector_icon_id = omnibox_view_->GetVectorIcon(in_dark_mode);
- if (in_dark_mode) {
- vector_icon_color = SK_ColorWHITE;
+ vector_icon_id = omnibox_view_->GetVectorIcon();
+ security_state::SecurityStateModel::SecurityLevel security_level =
+ GetToolbarModel()->GetSecurityLevel(false);
+ if (security_level == security_state::SecurityStateModel::NONE) {
+ vector_icon_color = gfx::kChromeIconGrey;
} else {
- vector_icon_color = OmniboxViewMac::BaseTextColorSkia(in_dark_mode);
+ NSColor* sRGBColor =
+ OmniboxViewMac::GetSecureTextColor(security_level, in_dark_mode);
+ NSColor* deviceColor =
+ [sRGBColor colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]];
+ vector_icon_color = skia::NSDeviceColorToSkColor(deviceColor);
}
}
+ // If the theme is dark, then the color should always be
+ // kMaterialDarkVectorIconColor.
+ if (in_dark_mode)
+ vector_icon_color = kMaterialDarkVectorIconColor;
+
DCHECK(vector_icon_id != gfx::VectorIconId::VECTOR_ICON_NONE);
NSImage* image =
[LocationBarImageRep imageForId:vector_icon_id color:vector_icon_color];
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698