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

Side by Side Diff: ui/gfx/native_theme_gtk.cc

Issue 8597015: Add a new GetSystemColor method to native theme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move bug-check color constant out of header file Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
15 namespace {
16 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128);
17 }
James Cook 2011/11/19 03:02:46 } // namespace
18
11 // static 19 // static
12 const NativeTheme* NativeTheme::instance() { 20 const NativeTheme* NativeTheme::instance() {
13 return NativeThemeGtk::instance(); 21 return NativeThemeGtk::instance();
14 } 22 }
15 23
16 // static 24 // static
17 const NativeThemeGtk* NativeThemeGtk::instance() { 25 const NativeThemeGtk* NativeThemeGtk::instance() {
18 CR_DEFINE_STATIC_LOCAL(NativeThemeGtk, s_native_theme, ()); 26 CR_DEFINE_STATIC_LOCAL(NativeThemeGtk, s_native_theme, ());
19 return &s_native_theme; 27 return &s_native_theme;
20 } 28 }
21 29
30 SkColor NativeThemeGtk::GetSystemColor(ColorId color_id) const {
31 switch (color_id) {
32 case kDialogBackgroundColorId:
33 return gfx::GdkColorToSkColor(
34 gtk_widget_get_default_style()->bg[GTK_STATE_NORMAL]);
35 default:
36 NOTREACHED() << "Invalid color_id: " << color_id;
37 break;
38 }
39 return kInvalidColorIdColor;
40 }
41
22 NativeThemeGtk::NativeThemeGtk() { 42 NativeThemeGtk::NativeThemeGtk() {
23 } 43 }
24 44
25 NativeThemeGtk::~NativeThemeGtk() { 45 NativeThemeGtk::~NativeThemeGtk() {
26 } 46 }
27 47
28 } // namespace gfx 48 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698