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 615318fe42c1d7e1a549b7f3fbd8387b5a41eb3f..7117665a2407e8f275bbef0346b3011536ecb51e 100644 |
| --- a/ui/views/controls/combobox/combobox.cc |
| +++ b/ui/views/controls/combobox/combobox.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/logging.h" |
| #include "base/macros.h" |
| #include "build/build_config.h" |
| +#include "ui/accessibility/ax_action_data.h" |
| #include "ui/accessibility/ax_node_data.h" |
| #include "ui/base/default_style.h" |
| #include "ui/base/ime/input_method.h" |
| @@ -766,6 +767,16 @@ void Combobox::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, model_->GetItemCount()); |
| } |
| +bool Combobox::HandleAccessibleAction(const ui::AXActionData& action_data) { |
| + // The action handling in View would generate a mouse event, but mouse events |
| + // for Combobox are handled by |arrow_button_|. Handle the action explicitly. |
|
msw
2017/06/29 19:26:12
nit: It's not clear from this comment why allowing
tapted
2017/06/30 06:04:47
The problem is that |arrow_button_| isn't exposed
|
| + if (enabled() && action_data.action == ui::AX_ACTION_DO_DEFAULT) { |
|
msw
2017/06/29 19:26:12
Do we need some logic for handling the event when
tapted
2017/06/30 06:04:47
I don't think so. I am not a VoiceOver expert but
|
| + ShowDropDownMenu(ui::MENU_SOURCE_KEYBOARD); |
| + return true; |
| + } |
| + return View::HandleAccessibleAction(action_data); |
| +} |
| + |
| void Combobox::ButtonPressed(Button* sender, const ui::Event& event) { |
| if (!enabled()) |
| return; |