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

Unified Diff: chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc

Issue 2297453003: Handle alert severity colors in NativeThemeGtk2. (Closed)
Patch Set: Created 4 years, 4 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/libgtk2ui/native_theme_gtk2.cc
diff --git a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
index 5d823efbc0c4d6624356d1a4fbf416f878c13c4a..bc03083b34101e26f5daec027a74687b1e5d1aa1 100644
--- a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
+++ b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
@@ -19,6 +19,8 @@
#include "ui/gfx/path.h"
#include "ui/gfx/skia_util.h"
#include "ui/native_theme/common_theme.h"
+#include "ui/native_theme/native_theme_aura.h"
+#include "ui/native_theme/native_theme_dark_aura.h"
namespace libgtk2ui {
@@ -455,11 +457,17 @@ SkColor NativeThemeGtk2::GetSystemColor(ColorId color_id) const {
0x80);
// Alert icons
- // These aren't yet used in any GTK NativeTheme context, so they don't have
- // definitions.
+ // Just fall back to the same colors as Aura.
case kColorId_AlertSeverityLow:
case kColorId_AlertSeverityMedium:
- case kColorId_AlertSeverityHigh:
+ case kColorId_AlertSeverityHigh: {
+ ui::NativeTheme* fallback_theme =
+ color_utils::IsDark(GetTextColor(GetEntry(), NORMAL))
+ ? ui::NativeThemeAura::instance()
+ : ui::NativeThemeDarkAura::instance();
+ return fallback_theme->GetSystemColor(color_id);
+ }
+
case kColorId_NumColors:
NOTREACHED();
break;
« 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