Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: chrome/browser/ui/libgtkui/native_theme_gtk3.h

Issue 2717943002: Fix cc/paint skia type mismatches (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 PaintArrowButton(SkCanvas* canvas, 24 void PaintArrowButton(cc::PaintCanvas* canvas,
25 const gfx::Rect& rect, 25 const gfx::Rect& rect,
26 Part direction, 26 Part direction,
27 State state) const override; 27 State state) const override;
28 void PaintScrollbarTrack(SkCanvas* canvas, 28 void PaintScrollbarTrack(cc::PaintCanvas* canvas,
29 Part part, 29 Part part,
30 State state, 30 State state,
31 const ScrollbarTrackExtraParams& extra_params, 31 const ScrollbarTrackExtraParams& extra_params,
32 const gfx::Rect& rect) const override; 32 const gfx::Rect& rect) const override;
33 void PaintScrollbarThumb( 33 void PaintScrollbarThumb(
34 SkCanvas* canvas, 34 cc::PaintCanvas* canvas,
35 Part part, 35 Part part,
36 State state, 36 State state,
37 const gfx::Rect& rect, 37 const gfx::Rect& rect,
38 NativeTheme::ScrollbarOverlayColorTheme theme) const override; 38 NativeTheme::ScrollbarOverlayColorTheme theme) const override;
39 void PaintScrollbarCorner(SkCanvas* canvas, 39 void PaintScrollbarCorner(cc::PaintCanvas* canvas,
40 State state, 40 State state,
41 const gfx::Rect& rect) const override; 41 const gfx::Rect& rect) const override;
42 void PaintMenuPopupBackground( 42 void PaintMenuPopupBackground(
43 cc::PaintCanvas* canvas, 43 cc::PaintCanvas* canvas,
44 const gfx::Size& size, 44 const gfx::Size& size,
45 const MenuBackgroundExtraParams& menu_background) const override; 45 const MenuBackgroundExtraParams& menu_background) const override;
46 void PaintMenuSeparator( 46 void PaintMenuSeparator(
47 SkCanvas* canvas, 47 cc::PaintCanvas* canvas,
48 State state, 48 State state,
49 const gfx::Rect& rect, 49 const gfx::Rect& rect,
50 const MenuSeparatorExtraParams& menu_separator) const override; 50 const MenuSeparatorExtraParams& menu_separator) const override;
51 void PaintMenuItemBackground( 51 void PaintMenuItemBackground(
52 cc::PaintCanvas* canvas, 52 cc::PaintCanvas* canvas,
53 State state, 53 State state,
54 const gfx::Rect& rect, 54 const gfx::Rect& rect,
55 const MenuItemExtraParams& menu_item) const override; 55 const MenuItemExtraParams& menu_item) const override;
56 void PaintFrameTopArea( 56 void PaintFrameTopArea(
57 SkCanvas* canvas, 57 cc::PaintCanvas* canvas,
58 State state, 58 State state,
59 const gfx::Rect& rect, 59 const gfx::Rect& rect,
60 const FrameTopAreaExtraParams& frame_top_area) const override; 60 const FrameTopAreaExtraParams& frame_top_area) const override;
61 61
62 private: 62 private:
63 NativeThemeGtk3(); 63 NativeThemeGtk3();
64 ~NativeThemeGtk3() override; 64 ~NativeThemeGtk3() override;
65 65
66 mutable base::Optional<SkColor> color_cache_[kColorId_NumColors]; 66 mutable base::Optional<SkColor> color_cache_[kColorId_NumColors];
67 67
68 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk3); 68 DISALLOW_COPY_AND_ASSIGN(NativeThemeGtk3);
69 }; 69 };
70 70
71 } // namespace libgtkui 71 } // namespace libgtkui
72 72
73 #endif // CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK3_H_ 73 #endif // CHROME_BROWSER_UI_LIBGTKUI_NATIVE_THEME_GTK3_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtkui/native_theme_gtk2.cc ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698