OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_GTK3_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK3_H_ |
6 #define CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK3_H_ | 6 #define CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK3_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/optional.h" | 9 #include "base/optional.h" |
10 #include "ui/native_theme/native_theme_base.h" | 10 #include "ui/native_theme/native_theme_base.h" |
11 | 11 |
12 namespace libgtkui { | 12 namespace libgtkui { |
13 | 13 |
14 // A version of NativeTheme that uses GTK3-rendered widgets. | 14 // A version of NativeTheme that uses GTK3-rendered widgets. |
15 class NativeThemeGtk3 : public ui::NativeThemeBase { | 15 class NativeThemeGtk3 : public ui::NativeThemeBase { |
16 public: | 16 public: |
17 static NativeThemeGtk3* instance(); | 17 static NativeThemeGtk3* instance(); |
18 | 18 |
19 // Called when gtk theme changes. | 19 // Called when gtk theme changes. |
20 void ResetColorCache(); | 20 void ResetColorCache(); |
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 PaintMenuSeparator( |
| 29 SkCanvas* canvas, |
| 30 State state, |
| 31 const gfx::Rect& rect, |
| 32 const MenuSeparatorExtraParams& menu_separator) const override; |
28 void PaintMenuItemBackground( | 33 void PaintMenuItemBackground( |
29 SkCanvas* canvas, | 34 SkCanvas* canvas, |
30 State state, | 35 State state, |
31 const gfx::Rect& rect, | 36 const gfx::Rect& rect, |
32 const MenuItemExtraParams& menu_item) const override; | 37 const MenuItemExtraParams& menu_item) const override; |
33 void PaintFrameTopArea( | 38 void PaintFrameTopArea( |
34 SkCanvas* canvas, | 39 SkCanvas* canvas, |
35 State state, | 40 State state, |
36 const gfx::Rect& rect, | 41 const gfx::Rect& rect, |
37 const FrameTopAreaExtraParams& frame_top_area) const override; | 42 const FrameTopAreaExtraParams& frame_top_area) const override; |
38 | 43 |
39 private: | 44 private: |
40 NativeThemeGtk3(); | 45 NativeThemeGtk3(); |
41 ~NativeThemeGtk3() override; | 46 ~NativeThemeGtk3() override; |
42 | 47 |
43 mutable base::Optional<SkColor> color_cache_[kColorId_NumColors]; | 48 mutable base::Optional<SkColor> color_cache_[kColorId_NumColors]; |
44 | 49 |
45 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk3); | 50 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk3); |
46 }; | 51 }; |
47 | 52 |
48 } // namespace libgtkui | 53 } // namespace libgtkui |
49 | 54 |
50 #endif // CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK3_H_ | 55 #endif // CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK3_H_ |
OLD | NEW |