| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/native_theme_gtk.h" | 5 #include "ui/gfx/native_theme_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> |
| 8 |
| 7 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" |
| 11 #include "ui/gfx/skia_utils_gtk.h" |
| 8 | 12 |
| 9 namespace gfx { | 13 namespace gfx { |
| 10 | 14 |
| 11 // static | 15 // static |
| 12 const NativeTheme* NativeTheme::instance() { | 16 const NativeTheme* NativeTheme::instance() { |
| 13 return NativeThemeGtk::instance(); | 17 return NativeThemeGtk::instance(); |
| 14 } | 18 } |
| 15 | 19 |
| 16 // static | 20 // static |
| 17 const NativeThemeGtk* NativeThemeGtk::instance() { | 21 const NativeThemeGtk* NativeThemeGtk::instance() { |
| 18 CR_DEFINE_STATIC_LOCAL(NativeThemeGtk, s_native_theme, ()); | 22 CR_DEFINE_STATIC_LOCAL(NativeThemeGtk, s_native_theme, ()); |
| 19 return &s_native_theme; | 23 return &s_native_theme; |
| 20 } | 24 } |
| 21 | 25 |
| 26 SkColor NativeThemeGtk::GetSystemColor(ColorId color_id) const { |
| 27 switch (color_id) { |
| 28 case kDialogBackgroundColor: |
| 29 return gfx::GdkColorToSkColor( |
| 30 gtk_widget_get_default_style()->bg[GTK_STATE_NORMAL]); |
| 31 default: |
| 32 NOTREACHED() << "Invalid color_id: " << color_id; |
| 33 break; |
| 34 } |
| 35 return SkColorSetRGB(255, 0, 0); // warning red |
| 36 } |
| 37 |
| 22 NativeThemeGtk::NativeThemeGtk() { | 38 NativeThemeGtk::NativeThemeGtk() { |
| 23 } | 39 } |
| 24 | 40 |
| 25 NativeThemeGtk::~NativeThemeGtk() { | 41 NativeThemeGtk::~NativeThemeGtk() { |
| 26 } | 42 } |
| 27 | 43 |
| 28 } // namespace gfx | 44 } // namespace gfx |
| OLD | NEW |