| 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/tree/tree_view.h" | 5 #include "ui/views/controls/tree/tree_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 gfx::Point local_point(p); | 407 gfx::Point local_point(p); |
| 408 ConvertPointFromScreen(this, &local_point); | 408 ConvertPointFromScreen(this, &local_point); |
| 409 if (!GetNodeAtPoint(local_point)) | 409 if (!GetNodeAtPoint(local_point)) |
| 410 return; | 410 return; |
| 411 } | 411 } |
| 412 View::ShowContextMenu(p, source_type); | 412 View::ShowContextMenu(p, source_type); |
| 413 } | 413 } |
| 414 | 414 |
| 415 void TreeView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 415 void TreeView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 416 node_data->role = ui::AX_ROLE_TREE; | 416 node_data->role = ui::AX_ROLE_TREE; |
| 417 node_data->AddStateFlag(ui::AX_STATE_READ_ONLY); | 417 node_data->AddState(ui::AX_STATE_READ_ONLY); |
| 418 if (!selected_node_) | 418 if (!selected_node_) |
| 419 return; | 419 return; |
| 420 | 420 |
| 421 // Get selected item info. | 421 // Get selected item info. |
| 422 node_data->role = ui::AX_ROLE_TREE_ITEM; | 422 node_data->role = ui::AX_ROLE_TREE_ITEM; |
| 423 node_data->SetName(selected_node_->model_node()->GetTitle()); | 423 node_data->SetName(selected_node_->model_node()->GetTitle()); |
| 424 } | 424 } |
| 425 | 425 |
| 426 const char* TreeView::GetClassName() const { | 426 const char* TreeView::GetClassName() const { |
| 427 return kViewClassName; | 427 return kViewClassName; |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 if (!is_expanded_) | 1099 if (!is_expanded_) |
| 1100 return max_width; | 1100 return max_width; |
| 1101 for (int i = 0; i < child_count(); ++i) { | 1101 for (int i = 0; i < child_count(); ++i) { |
| 1102 max_width = std::max(max_width, | 1102 max_width = std::max(max_width, |
| 1103 GetChild(i)->GetMaxWidth(indent, depth + 1)); | 1103 GetChild(i)->GetMaxWidth(indent, depth + 1)); |
| 1104 } | 1104 } |
| 1105 return max_width; | 1105 return max_width; |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 } // namespace views | 1108 } // namespace views |
| OLD | NEW |