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

Side by Side Diff: ui/views/border.cc

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 #include "ui/views/border.h" 5 #include "ui/views/border.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 // static 182 // static
183 std::unique_ptr<Border> Border::NullBorder() { 183 std::unique_ptr<Border> Border::NullBorder() {
184 return nullptr; 184 return nullptr;
185 } 185 }
186 186
187 // static 187 // static
188 std::unique_ptr<Border> Border::CreateSolidBorder(int thickness, 188 std::unique_ptr<Border> Border::CreateSolidBorder(int thickness,
189 SkColor color) { 189 SkColor color) {
190 return base::WrapUnique(new SolidSidedBorder(gfx::Insets(thickness), color)); 190 return base::MakeUnique<SolidSidedBorder>(gfx::Insets(thickness), color);
191 } 191 }
192 192
193 // static 193 // static
194 std::unique_ptr<Border> Border::CreateEmptyBorder(const gfx::Insets& insets) { 194 std::unique_ptr<Border> Border::CreateEmptyBorder(const gfx::Insets& insets) {
195 return base::WrapUnique(new EmptyBorder(insets)); 195 return base::MakeUnique<EmptyBorder>(insets);
196 } 196 }
197 197
198 // static 198 // static
199 std::unique_ptr<Border> Border::CreateRoundedRectBorder(int thickness, 199 std::unique_ptr<Border> Border::CreateRoundedRectBorder(int thickness,
200 int corner_radius, 200 int corner_radius,
201 SkColor color) { 201 SkColor color) {
202 return base::WrapUnique( 202 return base::MakeUnique<RoundedRectBorder>(thickness, corner_radius, color);
203 new RoundedRectBorder(thickness, corner_radius, color));
204 } 203 }
205 204
206 // static 205 // static
207 std::unique_ptr<Border> Border::CreateEmptyBorder(int top, 206 std::unique_ptr<Border> Border::CreateEmptyBorder(int top,
208 int left, 207 int left,
209 int bottom, 208 int bottom,
210 int right) { 209 int right) {
211 return CreateEmptyBorder(gfx::Insets(top, left, bottom, right)); 210 return CreateEmptyBorder(gfx::Insets(top, left, bottom, right));
212 } 211 }
213 212
214 // static 213 // static
215 std::unique_ptr<Border> Border::CreateSolidSidedBorder(int top, 214 std::unique_ptr<Border> Border::CreateSolidSidedBorder(int top,
216 int left, 215 int left,
217 int bottom, 216 int bottom,
218 int right, 217 int right,
219 SkColor color) { 218 SkColor color) {
220 return base::WrapUnique( 219 return base::MakeUnique<SolidSidedBorder>(
221 new SolidSidedBorder(gfx::Insets(top, left, bottom, right), color)); 220 gfx::Insets(top, left, bottom, right), color);
222 } 221 }
223 222
224 // static 223 // static
225 std::unique_ptr<Border> Border::CreateBorderPainter( 224 std::unique_ptr<Border> Border::CreateBorderPainter(
226 std::unique_ptr<Painter> painter, 225 std::unique_ptr<Painter> painter,
227 const gfx::Insets& insets) { 226 const gfx::Insets& insets) {
228 return base::WrapUnique(new BorderPainter(std::move(painter), insets)); 227 return base::WrapUnique(new BorderPainter(std::move(painter), insets));
229 } 228 }
230 229
231 } // namespace views 230 } // namespace views
OLDNEW
« no previous file with comments | « ui/touch_selection/touch_selection_controller_unittest.cc ('k') | ui/views/controls/button/label_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698