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/table/table_view.h" | 5 #include "ui/views/controls/table/table_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 436 |
437 void TableView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 437 void TableView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
438 node_data->role = ui::AX_ROLE_TABLE; | 438 node_data->role = ui::AX_ROLE_TABLE; |
439 node_data->AddStateFlag(ui::AX_STATE_READ_ONLY); | 439 node_data->AddStateFlag(ui::AX_STATE_READ_ONLY); |
440 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, RowCount()); | 440 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, RowCount()); |
441 | 441 |
442 if (selection_model_.active() != ui::ListSelectionModel::kUnselectedIndex) { | 442 if (selection_model_.active() != ui::ListSelectionModel::kUnselectedIndex) { |
443 // Get information about the active item, this is not the same as the set | 443 // Get information about the active item, this is not the same as the set |
444 // of selected items (of which there could be more than one). | 444 // of selected items (of which there could be more than one). |
445 node_data->role = ui::AX_ROLE_ROW; | 445 node_data->role = ui::AX_ROLE_ROW; |
446 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, | 446 node_data->AddValidatedIntAttribute(ui::AX_ATTR_INDEX_IN_SET, |
447 selection_model_.active()); | 447 selection_model_.active()); |
448 if (selection_model_.IsSelected(selection_model_.active())) { | 448 if (selection_model_.IsSelected(selection_model_.active())) { |
449 node_data->AddStateFlag(ui::AX_STATE_SELECTED); | 449 node_data->AddStateFlag(ui::AX_STATE_SELECTED); |
450 } | 450 } |
451 | 451 |
452 std::vector<base::string16> name_parts; | 452 std::vector<base::string16> name_parts; |
453 for (const VisibleColumn& visible_column : visible_columns_) { | 453 for (const VisibleColumn& visible_column : visible_columns_) { |
454 base::string16 value = model_->GetText( | 454 base::string16 value = model_->GetText( |
455 selection_model_.active(), visible_column.column.id); | 455 selection_model_.active(), visible_column.column.id); |
456 if (!value.empty()) { | 456 if (!value.empty()) { |
457 name_parts.push_back(visible_column.column.title); | 457 name_parts.push_back(visible_column.column.title); |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 if (tooltip) | 949 if (tooltip) |
950 *tooltip = text; | 950 *tooltip = text; |
951 if (tooltip_origin) { | 951 if (tooltip_origin) { |
952 tooltip_origin->SetPoint(cell_bounds.x(), | 952 tooltip_origin->SetPoint(cell_bounds.x(), |
953 cell_bounds.y() + kTextVerticalPadding); | 953 cell_bounds.y() + kTextVerticalPadding); |
954 } | 954 } |
955 return true; | 955 return true; |
956 } | 956 } |
957 | 957 |
958 } // namespace views | 958 } // namespace views |
OLD | NEW |