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

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

Issue 1693713004: Don't fire a FOCUS accessibility event on a View that doesn't have focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 243
244 if (selected_node_) 244 if (selected_node_)
245 ScrollRectToVisible(GetBoundsForNode(selected_node_)); 245 ScrollRectToVisible(GetBoundsForNode(selected_node_));
246 246
247 // Notify controller if the old selection was empty to handle the case of 247 // Notify controller if the old selection was empty to handle the case of
248 // remove explicitly resetting selected_node_ before invoking this. 248 // remove explicitly resetting selected_node_ before invoking this.
249 if (controller_ && (changed || was_empty_selection)) 249 if (controller_ && (changed || was_empty_selection))
250 controller_->OnTreeViewSelectionChanged(this); 250 controller_->OnTreeViewSelectionChanged(this);
251 251
252 if (changed) { 252 if (changed)
253 // TODO(dmazzoni): Decide if EVENT_SELECTION_CHANGED is a better choice for 253 NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true);
254 // sub-item selection event.
255 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
256 }
257 } 254 }
258 255
259 TreeModelNode* TreeView::GetSelectedNode() { 256 TreeModelNode* TreeView::GetSelectedNode() {
260 return selected_node_ ? selected_node_->model_node() : NULL; 257 return selected_node_ ? selected_node_->model_node() : NULL;
261 } 258 }
262 259
263 void TreeView::Collapse(ui::TreeModelNode* model_node) { 260 void TreeView::Collapse(ui::TreeModelNode* model_node) {
264 // Don't collapse the root if the root isn't shown, otherwise nothing is 261 // Don't collapse the root if the root isn't shown, otherwise nothing is
265 // displayed. 262 // displayed.
266 if (model_node == root_.model_node() && !root_shown_) 263 if (model_node == root_.model_node() && !root_shown_)
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 if (!is_expanded_) 1041 if (!is_expanded_)
1045 return max_width; 1042 return max_width;
1046 for (int i = 0; i < child_count(); ++i) { 1043 for (int i = 0; i < child_count(); ++i) {
1047 max_width = std::max(max_width, 1044 max_width = std::max(max_width,
1048 GetChild(i)->GetMaxWidth(indent, depth + 1)); 1045 GetChild(i)->GetMaxWidth(indent, depth + 1));
1049 } 1046 }
1050 return max_width; 1047 return max_width;
1051 } 1048 }
1052 1049
1053 } // namespace views 1050 } // namespace views
OLDNEW
« ui/app_list/views/tile_item_view.cc ('K') | « ui/views/controls/button/custom_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698