| 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 #include "ui/views/controls/combobox/combobox.h" | 5 #include "ui/views/controls/combobox/combobox.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 // Border renders differently when focused. | 733 // Border renders differently when focused. |
| 734 SchedulePaint(); | 734 SchedulePaint(); |
| 735 if (UseMd()) | 735 if (UseMd()) |
| 736 FocusRing::Uninstall(this); | 736 FocusRing::Uninstall(this); |
| 737 } | 737 } |
| 738 | 738 |
| 739 void Combobox::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 739 void Combobox::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 740 node_data->role = ui::AX_ROLE_COMBO_BOX; | 740 node_data->role = ui::AX_ROLE_COMBO_BOX; |
| 741 node_data->SetName(accessible_name_); | 741 node_data->SetName(accessible_name_); |
| 742 node_data->SetValue(model_->GetItemAt(selected_index_)); | 742 node_data->SetValue(model_->GetItemAt(selected_index_)); |
| 743 if (enabled()) { |
| 744 node_data->AddIntAttribute(ui::AX_ATTR_ACTION, |
| 745 ui::AX_SUPPORTED_ACTION_OPEN); |
| 746 } |
| 743 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, selected_index_); | 747 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, selected_index_); |
| 744 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, model_->GetItemCount()); | 748 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, model_->GetItemCount()); |
| 745 } | 749 } |
| 746 | 750 |
| 747 void Combobox::ButtonPressed(Button* sender, const ui::Event& event) { | 751 void Combobox::ButtonPressed(Button* sender, const ui::Event& event) { |
| 748 if (!enabled()) | 752 if (!enabled()) |
| 749 return; | 753 return; |
| 750 | 754 |
| 751 if (!UseMd()) | 755 if (!UseMd()) |
| 752 RequestFocus(); | 756 RequestFocus(); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 const int kMdPaddingWidth = 8; | 996 const int kMdPaddingWidth = 8; |
| 993 int arrow_pad = UseMd() ? kMdPaddingWidth | 997 int arrow_pad = UseMd() ? kMdPaddingWidth |
| 994 : PlatformStyle::kComboboxNormalArrowPadding; | 998 : PlatformStyle::kComboboxNormalArrowPadding; |
| 995 int padding = style_ == STYLE_NORMAL | 999 int padding = style_ == STYLE_NORMAL |
| 996 ? arrow_pad * 2 | 1000 ? arrow_pad * 2 |
| 997 : kActionLeftPadding + kActionRightPadding; | 1001 : kActionLeftPadding + kActionRightPadding; |
| 998 return ArrowSize().width() + padding; | 1002 return ArrowSize().width() + padding; |
| 999 } | 1003 } |
| 1000 | 1004 |
| 1001 } // namespace views | 1005 } // namespace views |
| OLD | NEW |