1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_
6 #define CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_
8 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h"
9 #include "ui/native_theme/native_theme_base.h"
11 typedef struct _GdkColor GdkColor
;
12 typedef struct _GtkStyle GtkStyle
;
13 typedef struct _GtkWidget GtkWidget
;
17 // A version of NativeTheme that uses GTK2 supplied colours instead of the
18 // default aura colours. Analogue to NativeThemeWin, except that can't be
19 // compiled into the main chrome binary like the Windows code can.
20 class NativeThemeGtk2
: public ui::NativeThemeBase
{
22 static NativeThemeGtk2
* instance();
24 // Overridden from ui::NativeThemeBase:
25 virtual SkColor
GetSystemColor(ColorId color_id
) const OVERRIDE
;
26 virtual void PaintMenuPopupBackground(
28 const gfx::Size
& size
,
29 const MenuBackgroundExtraParams
& menu_background
) const OVERRIDE
;
30 virtual void PaintMenuItemBackground(
33 const gfx::Rect
& rect
,
34 const MenuListExtraParams
& menu_list
) const OVERRIDE
;
38 virtual ~NativeThemeGtk2();
40 // Implementation of GetSystemColor.
41 GdkColor
GetSystemGdkColor(ColorId color_id
) const;
43 // Returns styles associated with various widget types.
44 GtkWidget
* GetRealizedWindow() const;
45 GtkStyle
* GetWindowStyle() const;
46 GtkStyle
* GetEntryStyle() const;
47 GtkStyle
* GetLabelStyle() const;
48 GtkStyle
* GetButtonStyle() const;
49 GtkStyle
* GetMenuStyle() const;
50 GtkStyle
* GetMenuItemStyle() const;
52 mutable GtkWidget
* fake_window_
;
53 mutable OwnedWidgetGtk fake_entry_
;
54 mutable OwnedWidgetGtk fake_label_
;
55 mutable OwnedWidgetGtk fake_button_
;
57 mutable OwnedWidgetGtk fake_menu_
;
58 mutable GtkWidget
* fake_menu_item_
;
60 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk2
);
63 } // namespace libgtk2ui
65 #endif // CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_