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

Side by Side Diff: ui/native_theme/native_theme_base.h

Issue 2426793002: Aura overlay scrollbars adjust color for dark backgrounds (Closed)
Patch Set: add test and remove dead code Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ 5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_BASE_H_
6 #define UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ 6 #define UI_NATIVE_THEME_NATIVE_THEME_BASE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 17 matching lines...) Expand all
28 // NativeTheme implementation: 28 // NativeTheme implementation:
29 gfx::Size GetPartSize(Part part, 29 gfx::Size GetPartSize(Part part,
30 State state, 30 State state,
31 const ExtraParams& extra) const override; 31 const ExtraParams& extra) const override;
32 void Paint(SkCanvas* canvas, 32 void Paint(SkCanvas* canvas,
33 Part part, 33 Part part,
34 State state, 34 State state,
35 const gfx::Rect& rect, 35 const gfx::Rect& rect,
36 const ExtraParams& extra) const override; 36 const ExtraParams& extra) const override;
37 37
38 void PaintStateTransition(SkCanvas* canvas,
39 Part part,
40 State startState,
41 State endState,
42 double progress,
43 const gfx::Rect& rect) const override;
44
45 protected: 38 protected:
46 NativeThemeBase(); 39 NativeThemeBase();
47 ~NativeThemeBase() override; 40 ~NativeThemeBase() override;
48 41
49 // Draw the arrow. Used by scrollbar and inner spin button. 42 // Draw the arrow. Used by scrollbar and inner spin button.
50 virtual void PaintArrowButton( 43 virtual void PaintArrowButton(
51 SkCanvas* gc, 44 SkCanvas* gc,
52 const gfx::Rect& rect, 45 const gfx::Rect& rect,
53 Part direction, 46 Part direction,
54 State state) const; 47 State state) const;
55 // Paint the scrollbar track. Done before the thumb so that it can contain 48 // Paint the scrollbar track. Done before the thumb so that it can contain
56 // alpha. 49 // alpha.
57 virtual void PaintScrollbarTrack( 50 virtual void PaintScrollbarTrack(
58 SkCanvas* canvas, 51 SkCanvas* canvas,
59 Part part, 52 Part part,
60 State state, 53 State state,
61 const ScrollbarTrackExtraParams& extra_params, 54 const ScrollbarTrackExtraParams& extra_params,
62 const gfx::Rect& rect) const; 55 const gfx::Rect& rect) const;
63 // Draw the scrollbar thumb over the track. 56 // Draw the scrollbar thumb over the track.
64 virtual void PaintScrollbarThumb( 57 virtual void PaintScrollbarThumb(
65 SkCanvas* canvas, 58 SkCanvas* canvas,
66 Part part, 59 Part part,
67 State state, 60 State state,
68 const gfx::Rect& rect) const; 61 const gfx::Rect& rect,
62 NativeTheme::ScrollbarOverlayColorTheme theme) const;
69 63
70 virtual void PaintScrollbarCorner(SkCanvas* canvas, 64 virtual void PaintScrollbarCorner(SkCanvas* canvas,
71 State state, 65 State state,
72 const gfx::Rect& rect) const; 66 const gfx::Rect& rect) const;
73 67
74 virtual void PaintCheckbox( 68 virtual void PaintCheckbox(
75 SkCanvas* canvas, 69 SkCanvas* canvas,
76 State state, 70 State state,
77 const gfx::Rect& rect, 71 const gfx::Rect& rect,
78 const ButtonExtraParams& button) const; 72 const ButtonExtraParams& button) const;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 State state, 123 State state,
130 const gfx::Rect& rect, 124 const gfx::Rect& rect,
131 const InnerSpinButtonExtraParams& spin_button) const; 125 const InnerSpinButtonExtraParams& spin_button) const;
132 126
133 virtual void PaintProgressBar( 127 virtual void PaintProgressBar(
134 SkCanvas* canvas, 128 SkCanvas* canvas,
135 State state, 129 State state,
136 const gfx::Rect& rect, 130 const gfx::Rect& rect,
137 const ProgressBarExtraParams& progress_bar) const; 131 const ProgressBarExtraParams& progress_bar) const;
138 132
139 virtual void PaintScrollbarThumbStateTransition(SkCanvas* canvas,
140 Part part,
141 State startState,
142 State endState,
143 double progress,
144 const gfx::Rect& rect) const {
145 }
146
147 // Shrinks checkbox/radio button rect, if necessary, to make room for padding 133 // Shrinks checkbox/radio button rect, if necessary, to make room for padding
148 // and drop shadow. 134 // and drop shadow.
149 // TODO(mohsen): This is needed because checkboxes/radio buttons on Android 135 // TODO(mohsen): This is needed because checkboxes/radio buttons on Android
150 // have different padding from those on desktop Chrome. Get rid of this when 136 // have different padding from those on desktop Chrome. Get rid of this when
151 // crbug.com/530746 is resolved. 137 // crbug.com/530746 is resolved.
152 virtual void AdjustCheckboxRadioRectForPadding(SkRect* rect) const; 138 virtual void AdjustCheckboxRadioRectForPadding(SkRect* rect) const;
153 139
154 void set_scrollbar_button_length(int length) { 140 void set_scrollbar_button_length(int length) {
155 scrollbar_button_length_ = length; 141 scrollbar_button_length_ = length;
156 } 142 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 191
206 // The length of the arrow buttons, 0 means no buttons are drawn. 192 // The length of the arrow buttons, 0 means no buttons are drawn.
207 int scrollbar_button_length_; 193 int scrollbar_button_length_;
208 194
209 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase); 195 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase);
210 }; 196 };
211 197
212 } // namespace ui 198 } // namespace ui
213 199
214 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ 200 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698