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

Side by Side Diff: ui/views/controls/button/label_button_border.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
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_CONTROLS_BUTTON_LABEL_BUTTON_BORDER_H_ 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_BORDER_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_BORDER_H_ 6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_BORDER_H_
7 7
8 #include <memory>
9
8 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/gfx/geometry/insets.h" 12 #include "ui/gfx/geometry/insets.h"
12 #include "ui/views/border.h" 13 #include "ui/views/border.h"
13 #include "ui/views/controls/button/button.h" 14 #include "ui/views/controls/button/button.h"
14 #include "ui/views/painter.h" 15 #include "ui/views/painter.h"
15 16
16 namespace views { 17 namespace views {
17 18
18 // An empty Border with customizable insets used by a LabelButton. 19 // An empty Border with customizable insets used by a LabelButton.
19 class VIEWS_EXPORT LabelButtonBorder : public Border { 20 class VIEWS_EXPORT LabelButtonBorder : public Border {
20 public: 21 public:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void Paint(const View& view, gfx::Canvas* canvas) override; 55 void Paint(const View& view, gfx::Canvas* canvas) override;
55 gfx::Size GetMinimumSize() const override; 56 gfx::Size GetMinimumSize() const override;
56 57
57 // Get or set the painter used for the specified |focused| button |state|. 58 // Get or set the painter used for the specified |focused| button |state|.
58 // LabelButtonAssetBorder takes and retains ownership of |painter|. 59 // LabelButtonAssetBorder takes and retains ownership of |painter|.
59 Painter* GetPainter(bool focused, Button::ButtonState state); 60 Painter* GetPainter(bool focused, Button::ButtonState state);
60 void SetPainter(bool focused, Button::ButtonState state, Painter* painter); 61 void SetPainter(bool focused, Button::ButtonState state, Painter* painter);
61 62
62 private: 63 private:
63 // The painters used for each unfocused or focused button state. 64 // The painters used for each unfocused or focused button state.
64 scoped_ptr<Painter> painters_[2][Button::STATE_COUNT]; 65 std::unique_ptr<Painter> painters_[2][Button::STATE_COUNT];
65 66
66 DISALLOW_COPY_AND_ASSIGN(LabelButtonAssetBorder); 67 DISALLOW_COPY_AND_ASSIGN(LabelButtonAssetBorder);
67 }; 68 };
68 69
69 } // namespace views 70 } // namespace views
70 71
71 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_BORDER_H_ 72 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_BORDER_H_
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698