OLD | NEW |
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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // NativeTheme implementation: | 26 // NativeTheme implementation: |
27 virtual gfx::Size GetPartSize(Part part, | 27 virtual gfx::Size GetPartSize(Part part, |
28 State state, | 28 State state, |
29 const ExtraParams& extra) const OVERRIDE; | 29 const ExtraParams& extra) const OVERRIDE; |
30 virtual void Paint(SkCanvas* canvas, | 30 virtual void Paint(SkCanvas* canvas, |
31 Part part, | 31 Part part, |
32 State state, | 32 State state, |
33 const gfx::Rect& rect, | 33 const gfx::Rect& rect, |
34 const ExtraParams& extra) const OVERRIDE; | 34 const ExtraParams& extra) const OVERRIDE; |
35 | 35 |
| 36 virtual void PaintStateTransition(SkCanvas* canvas, |
| 37 Part part, |
| 38 State startState, |
| 39 State endState, |
| 40 double progress, |
| 41 const gfx::Rect& rect) const OVERRIDE; |
| 42 |
36 protected: | 43 protected: |
37 NativeThemeBase(); | 44 NativeThemeBase(); |
38 virtual ~NativeThemeBase(); | 45 virtual ~NativeThemeBase(); |
39 | 46 |
40 // Creates a gfx::Canvas wrapping an SkCanvas. | 47 // Creates a gfx::Canvas wrapping an SkCanvas. |
41 static scoped_ptr<gfx::Canvas> CreateCanvas(SkCanvas* sk_canvas); | 48 static scoped_ptr<gfx::Canvas> CreateCanvas(SkCanvas* sk_canvas); |
42 | 49 |
43 // Draw the arrow. Used by scrollbar and inner spin button. | 50 // Draw the arrow. Used by scrollbar and inner spin button. |
44 virtual void PaintArrowButton( | 51 virtual void PaintArrowButton( |
45 SkCanvas* gc, | 52 SkCanvas* gc, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 State state, | 130 State state, |
124 const gfx::Rect& rect, | 131 const gfx::Rect& rect, |
125 const InnerSpinButtonExtraParams& spin_button) const; | 132 const InnerSpinButtonExtraParams& spin_button) const; |
126 | 133 |
127 virtual void PaintProgressBar( | 134 virtual void PaintProgressBar( |
128 SkCanvas* canvas, | 135 SkCanvas* canvas, |
129 State state, | 136 State state, |
130 const gfx::Rect& rect, | 137 const gfx::Rect& rect, |
131 const ProgressBarExtraParams& progress_bar) const; | 138 const ProgressBarExtraParams& progress_bar) const; |
132 | 139 |
| 140 virtual void PaintScrollbarThumbStateTransition( |
| 141 SkCanvas* canvas, |
| 142 State startState, |
| 143 State endState, |
| 144 double progress, |
| 145 const gfx::Rect& rect) const {} |
| 146 |
133 void set_scrollbar_button_length(unsigned int length) { | 147 void set_scrollbar_button_length(unsigned int length) { |
134 scrollbar_button_length_ = length; | 148 scrollbar_button_length_ = length; |
135 } | 149 } |
136 int scrollbar_button_length() const { return scrollbar_button_length_; } | 150 int scrollbar_button_length() const { return scrollbar_button_length_; } |
137 | 151 |
138 bool IntersectsClipRectInt(SkCanvas* canvas, | 152 bool IntersectsClipRectInt(SkCanvas* canvas, |
139 int x, int y, int w, int h) const; | 153 int x, int y, int w, int h) const; |
140 | 154 |
141 void DrawImageInt(SkCanvas* canvas, const gfx::ImageSkia& image, | 155 void DrawImageInt(SkCanvas* canvas, const gfx::ImageSkia& image, |
142 int src_x, int src_y, int src_w, int src_h, | 156 int src_x, int src_y, int src_w, int src_h, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 204 |
191 unsigned int scrollbar_width_; | 205 unsigned int scrollbar_width_; |
192 unsigned int scrollbar_button_length_; | 206 unsigned int scrollbar_button_length_; |
193 | 207 |
194 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase); | 208 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase); |
195 }; | 209 }; |
196 | 210 |
197 } // namespace ui | 211 } // namespace ui |
198 | 212 |
199 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ | 213 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ |
OLD | NEW |