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

Unified Diff: chrome/browser/ui/libgtkui/native_theme_gtk3.cc

Issue 2771603003: Gtk3: Fallback on using Aura alert icon colors (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtkui/native_theme_gtk3.cc
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
index 7bdaaddc69ac70a208d97600b4c476c0038ce9f1..be3dd40b954fe35df07446283fcb09a18ae20e91 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
@@ -354,12 +354,18 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
return GetFgColor("GtkMenu#menu GtkSpinner#spinner:disabled");
// Alert icons
+ // Fallback to the same colors as Aura.
case ui::NativeTheme::kColorId_AlertSeverityLow:
- return GetBgColor("GtkInfoBar#infobar.info");
case ui::NativeTheme::kColorId_AlertSeverityMedium:
- return GetBgColor("GtkInfoBar#infobar.warning");
- case ui::NativeTheme::kColorId_AlertSeverityHigh:
- return GetBgColor("GtkInfoBar#infobar.error");
+ case ui::NativeTheme::kColorId_AlertSeverityHigh: {
+ // Alert icons appear on the toolbar, so use the toolbar BG
+ // color to determine if the dark Aura theme should be used.
+ ui::NativeTheme* fallback_theme =
+ color_utils::IsDark(GetBgColor("GtkToolbar#toolbar"))
+ ? ui::NativeTheme::GetInstanceForNativeUi()
+ : ui::NativeThemeDarkAura::instance();
+ return fallback_theme->GetSystemColor(color_id);
+ }
case ui::NativeTheme::kColorId_NumColors:
NOTREACHED();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698