diff options
Diffstat (limited to 'chromium/ui/views/examples/toggle_button_example.cc')
-rw-r--r-- | chromium/ui/views/examples/toggle_button_example.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chromium/ui/views/examples/toggle_button_example.cc b/chromium/ui/views/examples/toggle_button_example.cc index 3bc279ffc1e..66f63eb0561 100644 --- a/chromium/ui/views/examples/toggle_button_example.cc +++ b/chromium/ui/views/examples/toggle_button_example.cc @@ -29,12 +29,12 @@ void ToggleButtonExample::CreateExampleView(View* container) { auto layout = std::make_unique<BoxLayout>(BoxLayout::Orientation::kVertical); layout->set_cross_axis_alignment(BoxLayout::CrossAxisAlignment::kCenter); container->SetLayoutManager(std::move(layout)); - button_ = container->AddChildView(std::make_unique<ToggleButton>(this)); -} - -void ToggleButtonExample::ButtonPressed(Button* sender, - const ui::Event& event) { - PrintStatus("Pressed! count: %d", ++count_); + button_ = container->AddChildView( + std::make_unique<ToggleButton>(base::BindRepeating( + [](ToggleButtonExample* example) { + PrintStatus("Pressed! count: %d", ++example->count_); + }, + base::Unretained(this)))); } } // namespace examples |