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

Side by Side Diff: ui/base/nine_image_painter_factory.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 unified diff | Download patch
« no previous file with comments | « ui/base/nine_image_painter_factory.h ('k') | ui/base/resource/data_pack.h » ('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 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 #include "ui/base/nine_image_painter_factory.h" 5 #include "ui/base/nine_image_painter_factory.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/ptr_util.h"
9 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/nine_image_painter.h" 11 #include "ui/gfx/nine_image_painter.h"
11 12
12 namespace ui { 13 namespace ui {
13 14
14 namespace { 15 namespace {
15 16
16 std::vector<gfx::ImageSkia> ImageIdsToImages(const int image_ids[]) { 17 std::vector<gfx::ImageSkia> ImageIdsToImages(const int image_ids[]) {
17 DCHECK(image_ids); 18 DCHECK(image_ids);
18 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 19 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
19 std::vector<gfx::ImageSkia> images(9); 20 std::vector<gfx::ImageSkia> images(9);
20 for (size_t i = 0; i < 9; ++i) { 21 for (size_t i = 0; i < 9; ++i) {
21 if (image_ids[i] != 0) 22 if (image_ids[i] != 0)
22 images[i] = *rb.GetImageSkiaNamed(image_ids[i]); 23 images[i] = *rb.GetImageSkiaNamed(image_ids[i]);
23 } 24 }
24 return images; 25 return images;
25 } 26 }
26 27
27 } // namespace 28 } // namespace
28 29
29 scoped_ptr<gfx::NineImagePainter> CreateNineImagePainter( 30 std::unique_ptr<gfx::NineImagePainter> CreateNineImagePainter(
30 const int image_ids[]) { 31 const int image_ids[]) {
31 return make_scoped_ptr( 32 return base::WrapUnique(
32 new gfx::NineImagePainter(ImageIdsToImages(image_ids))); 33 new gfx::NineImagePainter(ImageIdsToImages(image_ids)));
33 } 34 }
34 35
35 } // namespace ui 36 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/nine_image_painter_factory.h ('k') | ui/base/resource/data_pack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698