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

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

Issue 1990703002: [Material][Mac] Update Omnibox bubble decorations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 7 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 c8aedec6ccff2c94107ab6326820efd5292eb0b6..3059f4b70121d321b3e38349c94376fd23cfec02 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
@@ -85,7 +85,11 @@ namespace {
const static int kFirstRunBubbleYOffset = 1;
const int kDefaultIconSize = 16;
-const int kMaterialSmallIconSize = 12;
+const int kMaterialIconSize = 18;
+
+// Color of the vector graphic icons when the location bar is dark.
+// SkColorSetARGB(0xCC, 0xFF, 0xFF 0xFF);
+const SkColor kMaterialDarkVectorIconColor = 0xCCFFFFFF;
} // namespace
@@ -567,8 +571,10 @@ void LocationBarViewMac::UpdateLocationIcon() {
int icon_size = kDefaultIconSize;
if (ShouldShowEVBubble()) {
vector_icon_id = gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_IN_CHIP;
- vector_icon_color = gfx::kGoogleGreen700;
- icon_size = kMaterialSmallIconSize;
+ vector_icon_color = in_dark_mode
+ ? LocationBarDecoration::kMaterialDarkModeTextColor
+ : gfx::kGoogleGreen700;
+ icon_size = kMaterialIconSize;
} else {
vector_icon_id = omnibox_view_->GetVectorIcon(in_dark_mode);
if (in_dark_mode) {
@@ -666,14 +672,16 @@ NSImage* LocationBarViewMac::GetKeywordImage(const base::string16& keyword) {
GetOmniboxIcon(template_url->GetExtensionId()).AsNSImage();
}
- return ui::MaterialDesignController::IsModeMaterial()
- ? NSImageFromImageSkiaWithColorSpace(
- gfx::CreateVectorIcon(
- gfx::VectorIconId::OMNIBOX_SEARCH,
- kDefaultIconSize,
- gfx::kGoogleBlue700),
- base::mac::GetSRGBColorSpace())
- : OmniboxViewMac::ImageForResource(IDR_OMNIBOX_SEARCH);
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ SkColor icon_color = IsLocationBarDark() ? kMaterialDarkVectorIconColor
+ : gfx::kGoogleBlue700;
+ return NSImageFromImageSkiaWithColorSpace(
+ gfx::CreateVectorIcon(gfx::VectorIconId::OMNIBOX_SEARCH,
+ kDefaultIconSize, icon_color),
+ base::mac::GetSRGBColorSpace());
+ }
+
+ return OmniboxViewMac::ImageForResource(IDR_OMNIBOX_SEARCH);
}
void LocationBarViewMac::PostNotification(NSString* notification) {
« 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