OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK2_H_ |
6 #define CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK_H_ | 6 #define CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK2_H_ |
7 | |
8 #include <gtk/gtk.h> | |
9 | 7 |
10 #include "base/macros.h" | 8 #include "base/macros.h" |
11 #include "ui/native_theme/native_theme_base.h" | 9 #include "ui/native_theme/native_theme_base.h" |
12 | 10 |
| 11 typedef struct _GtkWidget GtkWidget; |
| 12 |
13 namespace libgtkui { | 13 namespace libgtkui { |
14 | 14 |
15 // A version of NativeTheme that uses GTK2 supplied colours instead of the | 15 // A version of NativeTheme that uses GTK2 supplied colours instead of the |
16 // default aura colours. Analogue to NativeThemeWin, except that can't be | 16 // default aura colours. Analogue to NativeThemeWin, except that can't be |
17 // compiled into the main chrome binary like the Windows code can. | 17 // compiled into the main chrome binary like the Windows code can. |
18 class NativeThemeGtk2 : public ui::NativeThemeBase { | 18 class NativeThemeGtk2 : public ui::NativeThemeBase { |
19 public: | 19 public: |
20 static NativeThemeGtk2* instance(); | 20 static NativeThemeGtk2* instance(); |
21 | 21 |
22 // Overridden from ui::NativeThemeBase: | 22 // Overridden from ui::NativeThemeBase: |
23 SkColor GetSystemColor(ColorId color_id) const override; | 23 SkColor GetSystemColor(ColorId color_id) const override; |
24 void PaintMenuPopupBackground( | 24 void PaintMenuPopupBackground( |
25 SkCanvas* canvas, | 25 SkCanvas* canvas, |
26 const gfx::Size& size, | 26 const gfx::Size& size, |
27 const MenuBackgroundExtraParams& menu_background) const override; | 27 const MenuBackgroundExtraParams& menu_background) const override; |
28 void PaintMenuItemBackground( | 28 void PaintMenuItemBackground( |
29 SkCanvas* canvas, | 29 SkCanvas* canvas, |
30 State state, | 30 State state, |
31 const gfx::Rect& rect, | 31 const gfx::Rect& rect, |
32 const MenuItemExtraParams& menu_item) const override; | 32 const MenuItemExtraParams& menu_item) const override; |
33 | 33 |
34 // Gets a ChromeGtkFrame theme color; returns true on success. Always returns | 34 private: |
35 // false in GTK3. | 35 NativeThemeGtk2(); |
36 bool GetChromeStyleColor(const char* style_property, | 36 ~NativeThemeGtk2() override; |
37 SkColor* ret_color) const; | |
38 | 37 |
39 // Returns various widgets for theming use. | 38 // Returns various widgets for theming use. |
40 GtkWidget* GetWindow() const; | 39 GtkWidget* GetWindow() const; |
41 GtkWidget* GetEntry() const; | 40 GtkWidget* GetEntry() const; |
42 GtkWidget* GetLabel() const; | 41 GtkWidget* GetLabel() const; |
43 GtkWidget* GetButton() const; | 42 GtkWidget* GetButton() const; |
44 GtkWidget* GetBlueButton() const; | 43 GtkWidget* GetBlueButton() const; |
45 GtkWidget* GetTree() const; | 44 GtkWidget* GetTree() const; |
46 GtkWidget* GetTooltip() const; | 45 GtkWidget* GetTooltip() const; |
47 GtkWidget* GetMenu() const; | 46 GtkWidget* GetMenu() const; |
48 GtkWidget* GetMenuItem() const; | 47 GtkWidget* GetMenuItem() const; |
49 | 48 |
50 private: | |
51 NativeThemeGtk2(); | |
52 ~NativeThemeGtk2() override; | |
53 | |
54 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk2); | 49 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk2); |
55 }; | 50 }; |
56 | 51 |
57 } // namespace libgtkui | 52 } // namespace libgtkui |
58 | 53 |
59 #endif // CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK_H_ | 54 #endif // CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK2_H_ |
OLD | NEW |