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_LIBGTK2UI_NATIVE_THEME_GTK2_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_ |
6 #define CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_ | 6 #define CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" | 10 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" |
11 #include "ui/native_theme/native_theme_base.h" | 11 #include "ui/native_theme/native_theme_base.h" |
12 | 12 |
13 typedef struct _GdkColor GdkColor; | 13 typedef struct _GdkColor GdkColor; |
14 | 14 |
15 namespace libgtk2ui { | 15 namespace libgtk2ui { |
16 | 16 |
17 // A version of NativeTheme that uses GTK2 supplied colours instead of the | 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 | 18 // default aura colours. Analogue to NativeThemeWin, except that can't be |
19 // compiled into the main chrome binary like the Windows code can. | 19 // compiled into the main chrome binary like the Windows code can. |
20 class NativeThemeGtk2 : public ui::NativeThemeBase { | 20 class NativeThemeGtk2 : public ui::NativeThemeBase { |
21 public: | 21 public: |
22 static NativeThemeGtk2* instance(); | 22 static NativeThemeGtk2* instance(); |
23 | 23 |
24 // Overridden from ui::NativeThemeBase: | 24 // Overridden from ui::NativeThemeBase: |
25 virtual gfx::Size GetPartSize(Part part, | 25 virtual gfx::Size GetPartSize(Part part, |
26 State state, | 26 State state, |
27 const ExtraParams& extra) const OVERRIDE; | 27 const ExtraParams& extra) const override; |
28 virtual void Paint(SkCanvas* canvas, | 28 virtual void Paint(SkCanvas* canvas, |
29 Part part, | 29 Part part, |
30 State state, | 30 State state, |
31 const gfx::Rect& rect, | 31 const gfx::Rect& rect, |
32 const ExtraParams& extra) const OVERRIDE; | 32 const ExtraParams& extra) const override; |
33 virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE; | 33 virtual SkColor GetSystemColor(ColorId color_id) const override; |
34 virtual void PaintMenuPopupBackground( | 34 virtual void PaintMenuPopupBackground( |
35 SkCanvas* canvas, | 35 SkCanvas* canvas, |
36 const gfx::Size& size, | 36 const gfx::Size& size, |
37 const MenuBackgroundExtraParams& menu_background) const OVERRIDE; | 37 const MenuBackgroundExtraParams& menu_background) const override; |
38 virtual void PaintMenuItemBackground( | 38 virtual void PaintMenuItemBackground( |
39 SkCanvas* canvas, | 39 SkCanvas* canvas, |
40 State state, | 40 State state, |
41 const gfx::Rect& rect, | 41 const gfx::Rect& rect, |
42 const MenuListExtraParams& menu_list) const OVERRIDE; | 42 const MenuListExtraParams& menu_list) const override; |
43 | 43 |
44 private: | 44 private: |
45 NativeThemeGtk2(); | 45 NativeThemeGtk2(); |
46 virtual ~NativeThemeGtk2(); | 46 virtual ~NativeThemeGtk2(); |
47 | 47 |
48 // Implementation of GetSystemColor. | 48 // Implementation of GetSystemColor. |
49 GdkColor GetSystemGdkColor(ColorId color_id) const; | 49 GdkColor GetSystemGdkColor(ColorId color_id) const; |
50 | 50 |
51 // Returns styles associated with various widget types. | 51 // Returns styles associated with various widget types. |
52 GtkWidget* GetRealizedWindow() const; | 52 GtkWidget* GetRealizedWindow() const; |
(...skipping 19 matching lines...) Expand all Loading... |
72 | 72 |
73 mutable OwnedWidgetGtk fake_menu_; | 73 mutable OwnedWidgetGtk fake_menu_; |
74 mutable GtkWidget* fake_menu_item_; | 74 mutable GtkWidget* fake_menu_item_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk2); | 76 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk2); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace libgtk2ui | 79 } // namespace libgtk2ui |
80 | 80 |
81 #endif // CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_ | 81 #endif // CHROME_BROWSER_UI_LIBGTK2UI_NATIVE_THEME_GTK2_H_ |
OLD | NEW |