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