| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |