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

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

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
« no previous file with comments | « ui/views/bubble/bubble_border.cc ('k') | ui/views/controls/button/label_button_border.cc » ('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 (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> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Overridden from LabelButtonBorder: 51 // Overridden from LabelButtonBorder:
52 bool PaintsButtonState(bool focused, Button::ButtonState state) override; 52 bool PaintsButtonState(bool focused, Button::ButtonState state) override;
53 53
54 // Overridden from Border: 54 // Overridden from Border:
55 void Paint(const View& view, gfx::Canvas* canvas) override; 55 void Paint(const View& view, gfx::Canvas* canvas) override;
56 gfx::Size GetMinimumSize() const override; 56 gfx::Size GetMinimumSize() const override;
57 57
58 // 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|.
59 // LabelButtonAssetBorder takes and retains ownership of |painter|. 59 // LabelButtonAssetBorder takes and retains ownership of |painter|.
60 Painter* GetPainter(bool focused, Button::ButtonState state); 60 Painter* GetPainter(bool focused, Button::ButtonState state);
61 void SetPainter(bool focused, Button::ButtonState state, Painter* painter); 61 void SetPainter(bool focused,
62 Button::ButtonState state,
63 std::unique_ptr<Painter> painter);
62 64
63 private: 65 private:
64 // The painters used for each unfocused or focused button state. 66 // The painters used for each unfocused or focused button state.
65 std::unique_ptr<Painter> painters_[2][Button::STATE_COUNT]; 67 std::unique_ptr<Painter> painters_[2][Button::STATE_COUNT];
66 68
67 DISALLOW_COPY_AND_ASSIGN(LabelButtonAssetBorder); 69 DISALLOW_COPY_AND_ASSIGN(LabelButtonAssetBorder);
68 }; 70 };
69 71
70 } // namespace views 72 } // namespace views
71 73
72 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_BORDER_H_ 74 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_BORDER_H_
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_border.cc ('k') | ui/views/controls/button/label_button_border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698