| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "skia/ext/platform_canvas.h" | 13 #include "skia/ext/platform_canvas.h" |
| 14 #include "ui/gfx/geometry/rect_f.h" |
| 14 #include "ui/native_theme/native_theme.h" | 15 #include "ui/native_theme/native_theme.h" |
| 15 | 16 |
| 16 namespace gfx { | 17 namespace gfx { |
| 17 class Canvas; | 18 class Canvas; |
| 18 class ImageSkia; | 19 class ImageSkia; |
| 19 class Rect; | 20 class Rect; |
| 20 class Size; | 21 class Size; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace ui { | 24 namespace ui { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Paints the arrow used on the scrollbar and spinner. | 164 // Paints the arrow used on the scrollbar and spinner. |
| 164 void PaintArrow(SkCanvas* canvas, | 165 void PaintArrow(SkCanvas* canvas, |
| 165 const gfx::Rect& rect, | 166 const gfx::Rect& rect, |
| 166 Part direction, | 167 Part direction, |
| 167 SkColor color) const; | 168 SkColor color) const; |
| 168 | 169 |
| 169 // Returns the color used to draw the arrow. | 170 // Returns the color used to draw the arrow. |
| 170 SkColor GetArrowColor(State state) const; | 171 SkColor GetArrowColor(State state) const; |
| 171 | 172 |
| 172 private: | 173 private: |
| 173 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest, VerticalArrows); | 174 friend class NativeThemeAuraTest; |
| 174 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest, HorizontalArrows); | |
| 175 | 175 |
| 176 SkPath PathForArrow(const gfx::Rect& rect, Part direction) const; | 176 SkPath PathForArrow(const gfx::Rect& rect, Part direction) const; |
| 177 gfx::RectF BoundingRectForArrow(const gfx::Rect& rect) const; |
| 177 | 178 |
| 178 void DrawVertLine(SkCanvas* canvas, | 179 void DrawVertLine(SkCanvas* canvas, |
| 179 int x, | 180 int x, |
| 180 int y1, | 181 int y1, |
| 181 int y2, | 182 int y2, |
| 182 const SkPaint& paint) const; | 183 const SkPaint& paint) const; |
| 183 void DrawHorizLine(SkCanvas* canvas, | 184 void DrawHorizLine(SkCanvas* canvas, |
| 184 int x1, | 185 int x1, |
| 185 int x2, | 186 int x2, |
| 186 int y, | 187 int y, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 205 | 206 |
| 206 // The length of the arrow buttons, 0 means no buttons are drawn. | 207 // The length of the arrow buttons, 0 means no buttons are drawn. |
| 207 unsigned int scrollbar_button_length_; | 208 unsigned int scrollbar_button_length_; |
| 208 | 209 |
| 209 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase); | 210 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase); |
| 210 }; | 211 }; |
| 211 | 212 |
| 212 } // namespace ui | 213 } // namespace ui |
| 213 | 214 |
| 214 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ | 215 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ |
| OLD | NEW |