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

Unified Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc

Issue 1438513003: [MD] Implement incognito colors as a NativeTheme (for Aura). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iterate on chips Created 5 years, 1 month 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
Index: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
index ca74f1715fbd476385744435fe89e89cfe84ba08..290dbbbae5b406b6b1b53edf262bce6dc99e6e36 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -116,8 +116,12 @@ void IconLabelBubbleView::OnNativeThemeChanged(
return;
label_->SetEnabledColor(GetTextColor());
- SkColor border_color = GetBorderColor();
- SkColor background_color = SkColorSetA(border_color, 0x13);
+
+ bool inverted =
+ color_utils::GetLuminanceForColor(parent_background_color_) < 128;
+ SkColor border_color = inverted ? SK_ColorWHITE : GetBorderColor();
+ SkColor background_color =
+ inverted ? SK_ColorWHITE : SkColorSetA(border_color, 0x13);
set_background(
new BackgroundWith1PxBorder(background_color, border_color, false));
SetLabelBackgroundColor(background_color);

Powered by Google App Engine
This is Rietveld 408576698