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_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
6 #define UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
13 #include "ui/views/background.h" | 14 #include "ui/views/background.h" |
14 #include "ui/views/border.h" | 15 #include "ui/views/border.h" |
15 | 16 |
16 class SkPath; | 17 class SkPath; |
17 | 18 |
18 namespace gfx { | 19 namespace gfx { |
19 class Path; | 20 class Path; |
20 class Rect; | 21 class Rect; |
21 } | 22 } |
22 | 23 |
23 namespace views { | 24 namespace views { |
24 class Painter; | 25 class Painter; |
25 | 26 |
26 namespace internal { | 27 namespace internal { |
27 | 28 |
28 // A helper that combines each border image-set painter with arrows and metrics. | 29 // A helper that combines each border image-set painter with arrows and metrics. |
29 struct BorderImages { | 30 struct BorderImages { |
30 BorderImages(const int border_image_ids[], | 31 BorderImages(const int border_image_ids[], |
31 const int arrow_image_ids[], | 32 const int arrow_image_ids[], |
32 int border_interior_thickness, | 33 int border_interior_thickness, |
33 int arrow_interior_thickness, | 34 int arrow_interior_thickness, |
34 int corner_radius); | 35 int corner_radius); |
35 virtual ~BorderImages(); | 36 virtual ~BorderImages(); |
36 | 37 |
37 scoped_ptr<Painter> border_painter; | 38 std::unique_ptr<Painter> border_painter; |
38 gfx::ImageSkia left_arrow; | 39 gfx::ImageSkia left_arrow; |
39 gfx::ImageSkia top_arrow; | 40 gfx::ImageSkia top_arrow; |
40 gfx::ImageSkia right_arrow; | 41 gfx::ImageSkia right_arrow; |
41 gfx::ImageSkia bottom_arrow; | 42 gfx::ImageSkia bottom_arrow; |
42 | 43 |
43 // The thickness of border and arrow images and their interior areas. | 44 // The thickness of border and arrow images and their interior areas. |
44 // Thickness is the width of left/right and the height of top/bottom images. | 45 // Thickness is the width of left/right and the height of top/bottom images. |
45 // The interior is measured without including stroke or shadow pixels. The tip | 46 // The interior is measured without including stroke or shadow pixels. The tip |
46 // of the arrow is |arrow_interior_thickness| from the border and the base is | 47 // of the arrow is |arrow_interior_thickness| from the border and the base is |
47 // always twice that; drawn in the background color. | 48 // always twice that; drawn in the background color. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 250 |
250 private: | 251 private: |
251 BubbleBorder* border_; | 252 BubbleBorder* border_; |
252 | 253 |
253 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); | 254 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); |
254 }; | 255 }; |
255 | 256 |
256 } // namespace views | 257 } // namespace views |
257 | 258 |
258 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 259 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
OLD | NEW |