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

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: Missed one call to SendFocusAlert 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
« no previous file with comments | « ui/views/controls/button/custom_button.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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_TEXT_CHANGED, true);
254 // sub-item selection event. 254 NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true);
255 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
256 } 255 }
257 } 256 }
258 257
259 TreeModelNode* TreeView::GetSelectedNode() { 258 TreeModelNode* TreeView::GetSelectedNode() {
260 return selected_node_ ? selected_node_->model_node() : NULL; 259 return selected_node_ ? selected_node_->model_node() : NULL;
261 } 260 }
262 261
263 void TreeView::Collapse(ui::TreeModelNode* model_node) { 262 void TreeView::Collapse(ui::TreeModelNode* model_node) {
264 // Don't collapse the root if the root isn't shown, otherwise nothing is 263 // Don't collapse the root if the root isn't shown, otherwise nothing is
265 // displayed. 264 // displayed.
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 if (!is_expanded_) 1043 if (!is_expanded_)
1045 return max_width; 1044 return max_width;
1046 for (int i = 0; i < child_count(); ++i) { 1045 for (int i = 0; i < child_count(); ++i) {
1047 max_width = std::max(max_width, 1046 max_width = std::max(max_width,
1048 GetChild(i)->GetMaxWidth(indent, depth + 1)); 1047 GetChild(i)->GetMaxWidth(indent, depth + 1));
1049 } 1048 }
1050 return max_width; 1049 return max_width;
1051 } 1050 }
1052 1051
1053 } // namespace views 1052 } // namespace views
OLDNEW
« no previous file with comments | « 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