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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 return; | 399 return; |
400 gfx::Rect bounds(GetBoundsForNodeImpl(node, row, depth)); | 400 gfx::Rect bounds(GetBoundsForNodeImpl(node, row, depth)); |
401 if (!bounds.Contains(local_point)) | 401 if (!bounds.Contains(local_point)) |
402 return; | 402 return; |
403 } | 403 } |
404 View::ShowContextMenu(p, source_type); | 404 View::ShowContextMenu(p, source_type); |
405 } | 405 } |
406 | 406 |
407 void TreeView::GetAccessibleState(ui::AXViewState* state) { | 407 void TreeView::GetAccessibleState(ui::AXViewState* state) { |
408 state->role = ui::AX_ROLE_TREE; | 408 state->role = ui::AX_ROLE_TREE; |
409 state->state = ui::AX_STATE_READ_ONLY; | 409 state->AddStateFlag(ui::AX_STATE_READ_ONLY); |
410 if (!selected_node_) | 410 if (!selected_node_) |
411 return; | 411 return; |
412 | 412 |
413 // Get selected item info. | 413 // Get selected item info. |
414 state->role = ui::AX_ROLE_TREE_ITEM; | 414 state->role = ui::AX_ROLE_TREE_ITEM; |
415 state->name = selected_node_->model_node()->GetTitle(); | 415 state->name = selected_node_->model_node()->GetTitle(); |
416 } | 416 } |
417 | 417 |
418 const char* TreeView::GetClassName() const { | 418 const char* TreeView::GetClassName() const { |
419 return kViewClassName; | 419 return kViewClassName; |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 if (!is_expanded_) | 1036 if (!is_expanded_) |
1037 return max_width; | 1037 return max_width; |
1038 for (int i = 0; i < child_count(); ++i) { | 1038 for (int i = 0; i < child_count(); ++i) { |
1039 max_width = std::max(max_width, | 1039 max_width = std::max(max_width, |
1040 GetChild(i)->GetMaxWidth(indent, depth + 1)); | 1040 GetChild(i)->GetMaxWidth(indent, depth + 1)); |
1041 } | 1041 } |
1042 return max_width; | 1042 return max_width; |
1043 } | 1043 } |
1044 | 1044 |
1045 } // namespace views | 1045 } // namespace views |
OLD | NEW |