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

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

Issue 2426793002: Aura overlay scrollbars adjust color for dark backgrounds (Closed)
Patch Set: fix 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 22 matching lines...) Expand all
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, 38 void PaintStateTransition(SkCanvas* canvas,
39 Part part, 39 Part part,
40 State startState, 40 State startState,
41 State endState, 41 State endState,
42 double progress, 42 double progress,
43 const gfx::Rect& rect) const override; 43 const gfx::Rect& rect,
44 ScrollbarOverlayColorTheme theme) const override;
44 45
45 protected: 46 protected:
46 NativeThemeBase(); 47 NativeThemeBase();
47 ~NativeThemeBase() override; 48 ~NativeThemeBase() override;
48 49
49 // Draw the arrow. Used by scrollbar and inner spin button. 50 // Draw the arrow. Used by scrollbar and inner spin button.
50 virtual void PaintArrowButton( 51 virtual void PaintArrowButton(
51 SkCanvas* gc, 52 SkCanvas* gc,
52 const gfx::Rect& rect, 53 const gfx::Rect& rect,
53 Part direction, 54 Part direction,
54 State state) const; 55 State state) const;
55 // Paint the scrollbar track. Done before the thumb so that it can contain 56 // Paint the scrollbar track. Done before the thumb so that it can contain
56 // alpha. 57 // alpha.
57 virtual void PaintScrollbarTrack( 58 virtual void PaintScrollbarTrack(
58 SkCanvas* canvas, 59 SkCanvas* canvas,
59 Part part, 60 Part part,
60 State state, 61 State state,
61 const ScrollbarTrackExtraParams& extra_params, 62 const ScrollbarTrackExtraParams& extra_params,
62 const gfx::Rect& rect) const; 63 const gfx::Rect& rect) const;
63 // Draw the scrollbar thumb over the track. 64 // Draw the scrollbar thumb over the track.
64 virtual void PaintScrollbarThumb( 65 virtual void PaintScrollbarThumb(
65 SkCanvas* canvas, 66 SkCanvas* canvas,
66 Part part, 67 Part part,
67 State state, 68 State state,
68 const gfx::Rect& rect) const; 69 const gfx::Rect& rect,
70 NativeTheme::ScrollbarOverlayColorTheme theme) const;
69 71
70 virtual void PaintScrollbarCorner(SkCanvas* canvas, 72 virtual void PaintScrollbarCorner(SkCanvas* canvas,
71 State state, 73 State state,
72 const gfx::Rect& rect) const; 74 const gfx::Rect& rect) const;
73 75
74 virtual void PaintCheckbox( 76 virtual void PaintCheckbox(
75 SkCanvas* canvas, 77 SkCanvas* canvas,
76 State state, 78 State state,
77 const gfx::Rect& rect, 79 const gfx::Rect& rect,
78 const ButtonExtraParams& button) const; 80 const ButtonExtraParams& button) const;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 State state, 131 State state,
130 const gfx::Rect& rect, 132 const gfx::Rect& rect,
131 const InnerSpinButtonExtraParams& spin_button) const; 133 const InnerSpinButtonExtraParams& spin_button) const;
132 134
133 virtual void PaintProgressBar( 135 virtual void PaintProgressBar(
134 SkCanvas* canvas, 136 SkCanvas* canvas,
135 State state, 137 State state,
136 const gfx::Rect& rect, 138 const gfx::Rect& rect,
137 const ProgressBarExtraParams& progress_bar) const; 139 const ProgressBarExtraParams& progress_bar) const;
138 140
139 virtual void PaintScrollbarThumbStateTransition(SkCanvas* canvas, 141 virtual void PaintScrollbarThumbStateTransition(
140 Part part, 142 SkCanvas* canvas,
141 State startState, 143 Part part,
142 State endState, 144 State startState,
143 double progress, 145 State endState,
144 const gfx::Rect& rect) const { 146 double progress,
145 } 147 const gfx::Rect& rect,
148 ScrollbarOverlayColorTheme theme) const {}
146 149
147 // Shrinks checkbox/radio button rect, if necessary, to make room for padding 150 // Shrinks checkbox/radio button rect, if necessary, to make room for padding
148 // and drop shadow. 151 // and drop shadow.
149 // TODO(mohsen): This is needed because checkboxes/radio buttons on Android 152 // 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 153 // have different padding from those on desktop Chrome. Get rid of this when
151 // crbug.com/530746 is resolved. 154 // crbug.com/530746 is resolved.
152 virtual void AdjustCheckboxRadioRectForPadding(SkRect* rect) const; 155 virtual void AdjustCheckboxRadioRectForPadding(SkRect* rect) const;
153 156
154 void set_scrollbar_button_length(int length) { 157 void set_scrollbar_button_length(int length) {
155 scrollbar_button_length_ = length; 158 scrollbar_button_length_ = length;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 208
206 // The length of the arrow buttons, 0 means no buttons are drawn. 209 // The length of the arrow buttons, 0 means no buttons are drawn.
207 int scrollbar_button_length_; 210 int scrollbar_button_length_;
208 211
209 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase); 212 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase);
210 }; 213 };
211 214
212 } // namespace ui 215 } // namespace ui
213 216
214 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ 217 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698