Index: ui/views/controls/tree/tree_view.cc |
diff --git a/ui/views/controls/tree/tree_view.cc b/ui/views/controls/tree/tree_view.cc |
index 78d4693e4a7fafecd0230d8bc0b5fe479580b1ee..35da6b7461e9a27914959eaa1866a86020ba2195 100644 |
--- a/ui/views/controls/tree/tree_view.cc |
+++ b/ui/views/controls/tree/tree_view.cc |
@@ -42,6 +42,9 @@ static const int kTextHorizontalPadding = 2; |
// How much children are indented from their parent. |
static const int kIndent = 20; |
+// static |
+const char TreeView::kViewClassName[] = "TreeView"; |
+ |
namespace { |
// Returns the color id for the background of selected text. |has_focus| |
@@ -229,6 +232,10 @@ void TreeView::SetSelectedNode(TreeModelNode* model_node) { |
if (selected_node_ && selected_node_ != &root_) |
Expand(model_->GetParent(selected_node_->model_node())); |
SchedulePaintForNode(selected_node_); |
+ |
+ // TODO(dmazzoni): Decide if EVENT_SELECTION_CHANGED is a better choice for |
+ // sub-item selection event. |
+ NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_FOCUS, true); |
sky
2013/11/24 18:58:28
Can you move this to the end of the function. I wo
zel
2013/12/02 05:36:10
Done.
|
} |
if (selected_node_) |
@@ -397,6 +404,16 @@ void TreeView::ShowContextMenu(const gfx::Point& p, |
void TreeView::GetAccessibleState(ui::AccessibleViewState* state) { |
state->role = ui::AccessibilityTypes::ROLE_OUTLINE; |
state->state = ui::AccessibilityTypes::STATE_READONLY; |
+ if (!selected_node_ || !selected_node_->model_node()) |
sky
2013/11/24 18:58:28
The second null check isn't necessary.
zel
2013/12/02 05:36:10
Done.
|
+ return; |
+ |
+ // Get selected item info. |
+ state->role = ui::AccessibilityTypes::ROLE_OUTLINEITEM; |
+ state->name = selected_node_->model_node()->GetTitle(); |
+} |
+ |
+const char* TreeView::GetClassName() const { |
+ return kViewClassName; |
} |
void TreeView::TreeNodesAdded(TreeModel* model, |