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

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

Issue 2009733002: Draw nicer arrows when the scrollbar buttons are not square. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor edits Created 4 years, 6 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 (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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_TEST_ALL_PREFIXES(NativeThemeAuraTest, VerticalArrows);
174 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest, HorizontalArrows); 175 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest, HorizontalArrows);
176 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest, ArrowForNonSquareButton);
177 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest, BoundingRectSquare);
178 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest,
179 BoundingRectSlightlyRectangular);
180 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest, BoundingRectVeryRectangular);
181 FRIEND_TEST_ALL_PREFIXES(NativeThemeAuraTest,
182 BoundingRectSnappedToWholePixels);
Peter Kasting 2016/06/10 01:03:23 When there are this many FRIEND_TESTs, consider wh
Bret 2016/06/11 00:11:43 Since I only need PathForArrow and BoundRectForArr
175 183
176 SkPath PathForArrow(const gfx::Rect& rect, Part direction) const; 184 SkPath PathForArrow(const gfx::Rect& rect, Part direction) const;
185 gfx::RectF BoundingRectForArrow(const gfx::Rect& rect) const;
177 186
178 void DrawVertLine(SkCanvas* canvas, 187 void DrawVertLine(SkCanvas* canvas,
179 int x, 188 int x,
180 int y1, 189 int y1,
181 int y2, 190 int y2,
182 const SkPaint& paint) const; 191 const SkPaint& paint) const;
183 void DrawHorizLine(SkCanvas* canvas, 192 void DrawHorizLine(SkCanvas* canvas,
184 int x1, 193 int x1,
185 int x2, 194 int x2,
186 int y, 195 int y,
(...skipping 18 matching lines...) Expand all
205 214
206 // The length of the arrow buttons, 0 means no buttons are drawn. 215 // The length of the arrow buttons, 0 means no buttons are drawn.
207 unsigned int scrollbar_button_length_; 216 unsigned int scrollbar_button_length_;
208 217
209 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase); 218 DISALLOW_COPY_AND_ASSIGN(NativeThemeBase);
210 }; 219 };
211 220
212 } // namespace ui 221 } // namespace ui
213 222
214 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_ 223 #endif // UI_NATIVE_THEME_NATIVE_THEME_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698