Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 2863703003: A11y: Rename AXSupportedAction to AXDefaultActionVerb. (Closed)
Patch Set: Rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 SchedulePaint(); 748 SchedulePaint();
749 if (UseMd()) 749 if (UseMd())
750 FocusRing::Uninstall(this); 750 FocusRing::Uninstall(this);
751 } 751 }
752 752
753 void Combobox::GetAccessibleNodeData(ui::AXNodeData* node_data) { 753 void Combobox::GetAccessibleNodeData(ui::AXNodeData* node_data) {
754 node_data->role = ui::AX_ROLE_COMBO_BOX; 754 node_data->role = ui::AX_ROLE_COMBO_BOX;
755 node_data->SetName(accessible_name_); 755 node_data->SetName(accessible_name_);
756 node_data->SetValue(model_->GetItemAt(selected_index_)); 756 node_data->SetValue(model_->GetItemAt(selected_index_));
757 if (enabled()) { 757 if (enabled()) {
758 node_data->AddIntAttribute(ui::AX_ATTR_ACTION, 758 node_data->AddIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB,
759 ui::AX_SUPPORTED_ACTION_OPEN); 759 ui::AX_DEFAULT_ACTION_VERB_OPEN);
760 } 760 }
761 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, selected_index_); 761 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, selected_index_);
762 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, model_->GetItemCount()); 762 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, model_->GetItemCount());
763 } 763 }
764 764
765 void Combobox::ButtonPressed(Button* sender, const ui::Event& event) { 765 void Combobox::ButtonPressed(Button* sender, const ui::Event& event) {
766 if (!enabled()) 766 if (!enabled())
767 return; 767 return;
768 768
769 if (!UseMd()) 769 if (!UseMd())
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 constexpr int kMdPaddingWidth = 8; 1010 constexpr int kMdPaddingWidth = 8;
1011 constexpr int kNormalPaddingWidth = 7; 1011 constexpr int kNormalPaddingWidth = 7;
1012 int arrow_pad = UseMd() ? kMdPaddingWidth : kNormalPaddingWidth; 1012 int arrow_pad = UseMd() ? kMdPaddingWidth : kNormalPaddingWidth;
1013 int padding = style_ == STYLE_NORMAL 1013 int padding = style_ == STYLE_NORMAL
1014 ? arrow_pad * 2 1014 ? arrow_pad * 2
1015 : kActionLeftPadding + kActionRightPadding; 1015 : kActionLeftPadding + kActionRightPadding;
1016 return ArrowSize().width() + padding; 1016 return ArrowSize().width() + padding;
1017 } 1017 }
1018 1018
1019 } // namespace views 1019 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698