| 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 return GetTooltipImpl(p, tooltip, NULL); | 438 return GetTooltipImpl(p, tooltip, NULL); |
| 439 } | 439 } |
| 440 | 440 |
| 441 bool TableView::GetTooltipTextOrigin(const gfx::Point& p, | 441 bool TableView::GetTooltipTextOrigin(const gfx::Point& p, |
| 442 gfx::Point* loc) const { | 442 gfx::Point* loc) const { |
| 443 return GetTooltipImpl(p, NULL, loc); | 443 return GetTooltipImpl(p, NULL, loc); |
| 444 } | 444 } |
| 445 | 445 |
| 446 void TableView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 446 void TableView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 447 node_data->role = ui::AX_ROLE_TABLE; | 447 node_data->role = ui::AX_ROLE_TABLE; |
| 448 node_data->AddStateFlag(ui::AX_STATE_READ_ONLY); | 448 node_data->AddState(ui::AX_STATE_READ_ONLY); |
| 449 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, RowCount()); | 449 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, RowCount()); |
| 450 | 450 |
| 451 if (selection_model_.active() != ui::ListSelectionModel::kUnselectedIndex) { | 451 if (selection_model_.active() != ui::ListSelectionModel::kUnselectedIndex) { |
| 452 // Get information about the active item, this is not the same as the set | 452 // Get information about the active item, this is not the same as the set |
| 453 // of selected items (of which there could be more than one). | 453 // of selected items (of which there could be more than one). |
| 454 node_data->role = ui::AX_ROLE_ROW; | 454 node_data->role = ui::AX_ROLE_ROW; |
| 455 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, | 455 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, |
| 456 selection_model_.active()); | 456 selection_model_.active()); |
| 457 if (selection_model_.IsSelected(selection_model_.active())) { | 457 if (selection_model_.IsSelected(selection_model_.active())) { |
| 458 node_data->AddStateFlag(ui::AX_STATE_SELECTED); | 458 node_data->AddState(ui::AX_STATE_SELECTED); |
| 459 } | 459 } |
| 460 | 460 |
| 461 std::vector<base::string16> name_parts; | 461 std::vector<base::string16> name_parts; |
| 462 for (const VisibleColumn& visible_column : visible_columns_) { | 462 for (const VisibleColumn& visible_column : visible_columns_) { |
| 463 base::string16 value = model_->GetText( | 463 base::string16 value = model_->GetText( |
| 464 selection_model_.active(), visible_column.column.id); | 464 selection_model_.active(), visible_column.column.id); |
| 465 if (!value.empty()) { | 465 if (!value.empty()) { |
| 466 name_parts.push_back(visible_column.column.title); | 466 name_parts.push_back(visible_column.column.title); |
| 467 name_parts.push_back(value); | 467 name_parts.push_back(value); |
| 468 } | 468 } |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 if (tooltip) | 957 if (tooltip) |
| 958 *tooltip = text; | 958 *tooltip = text; |
| 959 if (tooltip_origin) { | 959 if (tooltip_origin) { |
| 960 tooltip_origin->SetPoint(cell_bounds.x(), | 960 tooltip_origin->SetPoint(cell_bounds.x(), |
| 961 cell_bounds.y() + kTextVerticalPadding); | 961 cell_bounds.y() + kTextVerticalPadding); |
| 962 } | 962 } |
| 963 return true; | 963 return true; |
| 964 } | 964 } |
| 965 | 965 |
| 966 } // namespace views | 966 } // namespace views |
| OLD | NEW |