diff options
author | benrg@chromium.org <benrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 01:00:16 +0000 |
---|---|---|
committer | benrg@chromium.org <benrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 01:00:16 +0000 |
commit | 9040db835a0784877594e08ed8cb634375159a2c (patch) | |
tree | a706981f5072794de292432d29d4f645553ba913 /ui/gfx/native_theme_gtk.cc | |
parent | 093ce5d981b409eeb023c7927fd5110bac4ae755 (diff) | |
download | chromium_src-9040db835a0784877594e08ed8cb634375159a2c.zip chromium_src-9040db835a0784877594e08ed8cb634375159a2c.tar.gz chromium_src-9040db835a0784877594e08ed8cb634375159a2c.tar.bz2 |
Add a new GetSystemColor method to native theme.
Currently it only knows about the dialog box background color. The intent is to add other colors, such as the text
highlighting color (issue 100229). This CL also fixes issue
104229 by returning an opaque color on Aura.
BUG=104229
TEST=none
Review URL: http://codereview.chromium.org/8597015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/native_theme_gtk.cc')
-rw-r--r-- | ui/gfx/native_theme_gtk.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ui/gfx/native_theme_gtk.cc b/ui/gfx/native_theme_gtk.cc index ded9984..2e3290f 100644 --- a/ui/gfx/native_theme_gtk.cc +++ b/ui/gfx/native_theme_gtk.cc @@ -4,7 +4,17 @@ #include "ui/gfx/native_theme_gtk.h" +#include <gtk/gtk.h> + #include "base/basictypes.h" +#include "base/logging.h" +#include "ui/gfx/skia_utils_gtk.h" + +namespace { + +const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); + +} // namespace namespace gfx { @@ -19,6 +29,21 @@ const NativeThemeGtk* NativeThemeGtk::instance() { return &s_native_theme; } +SkColor NativeThemeGtk::GetSystemColor(ColorId color_id) const { + switch (color_id) { + case kColorId_DialogBackground: + // TODO(benrg): This code used to call gtk_widget_get_style() on the + // widget being styled. After refactoring, that widget is not available + // and we have to call gtk_widget_get_default_style(). Does it matter? + return gfx::GdkColorToSkColor( + gtk_widget_get_default_style()->bg[GTK_STATE_NORMAL]); + default: + NOTREACHED() << "Invalid color_id: " << color_id; + break; + } + return kInvalidColorIdColor; +} + NativeThemeGtk::NativeThemeGtk() { } |