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

Unified Diff: ui/views/painter.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/painter.h ('k') | ui/views/style/mac/dialog_button_border_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/painter.cc
diff --git a/ui/views/painter.cc b/ui/views/painter.cc
index 9a677956f84c7c5a86511cec79a9eb6597483f89..c182973c0a61ec0d2b758f39d4b606e31c79f6b5 100644
--- a/ui/views/painter.cc
+++ b/ui/views/painter.cc
@@ -4,9 +4,11 @@
#include "ui/views/painter.h"
+#include <memory>
+
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
@@ -149,9 +151,9 @@ class GradientPainter : public Painter {
// If |horizontal_| is true then the gradient is painted horizontally.
bool horizontal_;
// The gradient colors.
- scoped_ptr<SkColor[]> colors_;
+ std::unique_ptr<SkColor[]> colors_;
// The relative positions of the corresponding gradient colors.
- scoped_ptr<SkScalar[]> pos_;
+ std::unique_ptr<SkScalar[]> pos_;
// The number of elements in |colors_| and |pos_|.
size_t count_;
@@ -216,7 +218,7 @@ class ImagePainter : public Painter {
void Paint(gfx::Canvas* canvas, const gfx::Size& size) override;
private:
- scoped_ptr<gfx::NineImagePainter> nine_painter_;
+ std::unique_ptr<gfx::NineImagePainter> nine_painter_;
DISALLOW_COPY_AND_ASSIGN(ImagePainter);
};
@@ -313,21 +315,21 @@ Painter* Painter::CreateImageGridPainter(const int image_ids[]) {
}
// static
-scoped_ptr<Painter> Painter::CreateDashedFocusPainter() {
- return make_scoped_ptr(new DashedFocusPainter(gfx::Insets()));
+std::unique_ptr<Painter> Painter::CreateDashedFocusPainter() {
+ return base::WrapUnique(new DashedFocusPainter(gfx::Insets()));
}
// static
-scoped_ptr<Painter> Painter::CreateDashedFocusPainterWithInsets(
+std::unique_ptr<Painter> Painter::CreateDashedFocusPainterWithInsets(
const gfx::Insets& insets) {
- return make_scoped_ptr(new DashedFocusPainter(insets));
+ return base::WrapUnique(new DashedFocusPainter(insets));
}
// static
-scoped_ptr<Painter> Painter::CreateSolidFocusPainter(
+std::unique_ptr<Painter> Painter::CreateSolidFocusPainter(
SkColor color,
const gfx::Insets& insets) {
- return make_scoped_ptr(new SolidFocusPainter(color, insets));
+ return base::WrapUnique(new SolidFocusPainter(color, insets));
}
// HorizontalPainter ----------------------------------------------------------
« no previous file with comments | « ui/views/painter.h ('k') | ui/views/style/mac/dialog_button_border_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698