Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: ui/views/controls/tree/tree_view.cc

Issue 196133012: Fix incorrect use of AXState caused when refactoring two enums into one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename SetStateFlag -> AddStateFlag Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698