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

Side by Side Diff: ui/views/controls/button/label_button_border.cc

Issue 2637383003: Change Painter factory functions to unique_ptr (Closed)
Patch Set: msw review Created 3 years, 11 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/controls/button/label_button_border.h" 5 #include "ui/views/controls/button/label_button_border.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/skia/include/core/SkPaint.h" 8 #include "third_party/skia/include/core/SkPaint.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/animation/animation.h" 10 #include "ui/gfx/animation/animation.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return minimum_size; 176 return minimum_size;
177 } 177 }
178 178
179 Painter* LabelButtonAssetBorder::GetPainter(bool focused, 179 Painter* LabelButtonAssetBorder::GetPainter(bool focused,
180 Button::ButtonState state) { 180 Button::ButtonState state) {
181 return painters_[focused ? 1 : 0][state].get(); 181 return painters_[focused ? 1 : 0][state].get();
182 } 182 }
183 183
184 void LabelButtonAssetBorder::SetPainter(bool focused, 184 void LabelButtonAssetBorder::SetPainter(bool focused,
185 Button::ButtonState state, 185 Button::ButtonState state,
186 Painter* painter) { 186 std::unique_ptr<Painter> painter) {
187 painters_[focused ? 1 : 0][state].reset(painter); 187 painters_[focused ? 1 : 0][state] = std::move(painter);
188 } 188 }
189 189
190 } // namespace views 190 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button_border.h ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698