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

Side by Side Diff: ui/views/painter.h

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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
« no previous file with comments | « ui/views/mus/window_tree_host_mus.cc ('k') | ui/views/painter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_VIEWS_PAINTER_H_ 5 #ifndef UI_VIEWS_PAINTER_H_
6 #define UI_VIEWS_PAINTER_H_ 6 #define UI_VIEWS_PAINTER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory>
11
10 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
11 #include "base/macros.h" 13 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
14 #include "ui/base/nine_image_painter_factory.h" 15 #include "ui/base/nine_image_painter_factory.h"
15 #include "ui/views/views_export.h" 16 #include "ui/views/views_export.h"
16 17
17 namespace gfx { 18 namespace gfx {
18 class Canvas; 19 class Canvas;
19 class ImageSkia; 20 class ImageSkia;
20 class Insets; 21 class Insets;
21 class Rect; 22 class Rect;
22 class Size; 23 class Size;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 const gfx::Insets& insets); 71 const gfx::Insets& insets);
71 72
72 // Creates a painter that paints images in a scalable grid. The images must 73 // Creates a painter that paints images in a scalable grid. The images must
73 // share widths by column and heights by row. The corners are painted at full 74 // share widths by column and heights by row. The corners are painted at full
74 // size, while center and edge images are stretched to fill the painted area. 75 // size, while center and edge images are stretched to fill the painted area.
75 // The center image may be zero (to be skipped). This ordering must be used: 76 // The center image may be zero (to be skipped). This ordering must be used:
76 // Top-Left/Top/Top-Right/Left/[Center]/Right/Bottom-Left/Bottom/Bottom-Right. 77 // Top-Left/Top/Top-Right/Left/[Center]/Right/Bottom-Left/Bottom/Bottom-Right.
77 static Painter* CreateImageGridPainter(const int image_ids[]); 78 static Painter* CreateImageGridPainter(const int image_ids[]);
78 79
79 // Factory methods for creating painters intended for rendering focus. 80 // Factory methods for creating painters intended for rendering focus.
80 static scoped_ptr<Painter> CreateDashedFocusPainter(); 81 static std::unique_ptr<Painter> CreateDashedFocusPainter();
81 static scoped_ptr<Painter> CreateDashedFocusPainterWithInsets( 82 static std::unique_ptr<Painter> CreateDashedFocusPainterWithInsets(
82 const gfx::Insets& insets); 83 const gfx::Insets& insets);
83 static scoped_ptr<Painter> CreateSolidFocusPainter(SkColor color, 84 static std::unique_ptr<Painter> CreateSolidFocusPainter(
84 const gfx::Insets& insets); 85 SkColor color,
86 const gfx::Insets& insets);
85 87
86 // Returns the minimum size this painter can paint without obvious graphical 88 // Returns the minimum size this painter can paint without obvious graphical
87 // problems (e.g. overlapping images). 89 // problems (e.g. overlapping images).
88 virtual gfx::Size GetMinimumSize() const = 0; 90 virtual gfx::Size GetMinimumSize() const = 0;
89 91
90 // Paints the painter in the specified region. 92 // Paints the painter in the specified region.
91 virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) = 0; 93 virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) = 0;
92 94
93 private: 95 private:
94 DISALLOW_COPY_AND_ASSIGN(Painter); 96 DISALLOW_COPY_AND_ASSIGN(Painter);
(...skipping 24 matching lines...) Expand all
119 121
120 // NOTE: the images are owned by ResourceBundle. Don't free them. 122 // NOTE: the images are owned by ResourceBundle. Don't free them.
121 const gfx::ImageSkia* images_[3]; 123 const gfx::ImageSkia* images_[3];
122 124
123 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); 125 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter);
124 }; 126 };
125 127
126 } // namespace views 128 } // namespace views
127 129
128 #endif // UI_VIEWS_PAINTER_H_ 130 #endif // UI_VIEWS_PAINTER_H_
OLDNEW
« no previous file with comments | « ui/views/mus/window_tree_host_mus.cc ('k') | ui/views/painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698