OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BASE_NINE_IMAGE_PAINTER_FACTORY_H_ | 5 #ifndef UI_BASE_NINE_IMAGE_PAINTER_FACTORY_H_ |
6 #define UI_BASE_NINE_IMAGE_PAINTER_FACTORY_H_ | 6 #define UI_BASE_NINE_IMAGE_PAINTER_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include <memory> |
| 9 |
9 #include "ui/base/ui_base_export.h" | 10 #include "ui/base/ui_base_export.h" |
10 | 11 |
11 // A macro to define arrays of IDR constants used with CreateImageGridPainter. | 12 // A macro to define arrays of IDR constants used with CreateImageGridPainter. |
12 #define IMAGE_GRID(x) { x ## _TOP_LEFT, x ## _TOP, x ## _TOP_RIGHT, \ | 13 #define IMAGE_GRID(x) { x ## _TOP_LEFT, x ## _TOP, x ## _TOP_RIGHT, \ |
13 x ## _LEFT, x ## _CENTER, x ## _RIGHT, \ | 14 x ## _LEFT, x ## _CENTER, x ## _RIGHT, \ |
14 x ## _BOTTOM_LEFT, x ## _BOTTOM, x ## _BOTTOM_RIGHT, } | 15 x ## _BOTTOM_LEFT, x ## _BOTTOM, x ## _BOTTOM_RIGHT, } |
15 | 16 |
16 // Defines an empty image for use in macros for creating an image grid for a | 17 // Defines an empty image for use in macros for creating an image grid for a |
17 // ring of eight images. | 18 // ring of eight images. |
18 #define EMPTY_IMAGE 0 | 19 #define EMPTY_IMAGE 0 |
(...skipping 17 matching lines...) Expand all Loading... |
36 x ## _BOTTOM, EMPTY_IMAGE, EMPTY_IMAGE} | 37 x ## _BOTTOM, EMPTY_IMAGE, EMPTY_IMAGE} |
37 | 38 |
38 namespace gfx { | 39 namespace gfx { |
39 class NineImagePainter; | 40 class NineImagePainter; |
40 } | 41 } |
41 | 42 |
42 namespace ui { | 43 namespace ui { |
43 | 44 |
44 // Creates a NineImagePainter from an array of image ids. It's expected the | 45 // Creates a NineImagePainter from an array of image ids. It's expected the |
45 // array came from the IMAGE_GRID macro. | 46 // array came from the IMAGE_GRID macro. |
46 UI_BASE_EXPORT scoped_ptr<gfx::NineImagePainter> CreateNineImagePainter( | 47 UI_BASE_EXPORT std::unique_ptr<gfx::NineImagePainter> CreateNineImagePainter( |
47 const int image_ids[]); | 48 const int image_ids[]); |
48 | 49 |
49 } // namespace ui | 50 } // namespace ui |
50 | 51 |
51 #endif // UI_BASE_NINE_IMAGE_PAINTER_FACTORY_H_ | 52 #endif // UI_BASE_NINE_IMAGE_PAINTER_FACTORY_H_ |
OLD | NEW |