Chromium Code Reviews| Index: ui/views/controls/combobox/combobox.cc |
| diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc |
| index 3d7cfd1e26585dae22ab9fd8f8cfe5d876987304..aa7d0b5fe3d07d4126907af15f33f54855bf9ce5 100644 |
| --- a/ui/views/controls/combobox/combobox.cc |
| +++ b/ui/views/controls/combobox/combobox.cc |
| @@ -110,13 +110,19 @@ class TransparentButton : public CustomButton { |
| : CustomButton(listener) { |
| SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); |
| SetFocusBehavior(FocusBehavior::NEVER); |
| + set_notify_action(PlatformStyle::kMenuActivationAction); |
| } |
| ~TransparentButton() override {} |
| +#if defined(OS_MACOSX) |
|
sky
2016/06/29 21:35:08
This ifdef means we'll no longer get the old behav
tapted
2016/06/29 23:24:43
oh! yeah - this #ifdef needs to be inverted. (some
|
| + // Override OnMousePressed() to transfer focus to the parent() on a click |
| + // except on Mac, which doesn't transfer focus when buttons are clicked. |
| bool OnMousePressed(const ui::MouseEvent& mouse_event) override { |
| parent()->RequestFocus(); |
| + CustomButton::OnMousePressed(mouse_event); |
| return true; |
| } |
| +#endif |
| double GetAnimationValue() const { |
| return hover_animation().GetCurrentValue(); |