| Index: ui/views/controls/button/toggle_button.h
|
| diff --git a/ui/views/controls/button/toggle_button.h b/ui/views/controls/button/toggle_button.h
|
| index eb8efadfbd22aea374cab8b80f86fdc1b46772d3..de21cc36097cfcea7716396616111b8b5a1be31f 100644
|
| --- a/ui/views/controls/button/toggle_button.h
|
| +++ b/ui/views/controls/button/toggle_button.h
|
| @@ -10,6 +10,8 @@
|
|
|
| namespace views {
|
|
|
| +class Painter;
|
| +
|
| // This view presents a button that has two states: on and off. This is similar
|
| // to a checkbox but has no text and looks more like a two-state horizontal
|
| // slider.
|
| @@ -23,6 +25,13 @@ class VIEWS_EXPORT ToggleButton : public CustomButton {
|
| void SetIsOn(bool is_on, bool animate);
|
| bool is_on() const { return is_on_; }
|
|
|
| + void SetFocusPainter(std::unique_ptr<Painter> focus_painter);
|
| +
|
| + protected:
|
| + // View:
|
| + void OnFocus() override;
|
| + void OnBlur() override;
|
| +
|
| private:
|
| friend class TestToggleButton;
|
| class ThumbView;
|
| @@ -35,6 +44,8 @@ class VIEWS_EXPORT ToggleButton : public CustomButton {
|
|
|
| SkColor GetTrackColor(bool is_on) const;
|
|
|
| + Painter* focus_painter() { return focus_painter_.get(); }
|
| +
|
| // CustomButton:
|
| gfx::Size GetPreferredSize() const override;
|
| const char* GetClassName() const override;
|
| @@ -55,6 +66,7 @@ class VIEWS_EXPORT ToggleButton : public CustomButton {
|
| bool is_on_;
|
| gfx::SlideAnimation slide_animation_;
|
| ThumbView* thumb_view_;
|
| + std::unique_ptr<Painter> focus_painter_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ToggleButton);
|
| };
|
|
|