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

Side by Side Diff: ui/views/controls/table/table_view.cc

Issue 2769243002: Adjust initial activation/focus Task Manager/Views TableView. (Closed)
Patch Set: Created 3 years, 9 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/table/table_view.h" 5 #include "ui/views/controls/table/table_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 gfx::Point(group_indicator_x, start_cell_bounds.CenterPoint().y()), 619 gfx::Point(group_indicator_x, start_cell_bounds.CenterPoint().y()),
620 kGroupingIndicatorSize / 2, grouping_flags); 620 kGroupingIndicatorSize / 2, grouping_flags);
621 i = last + 1; 621 i = last + 1;
622 } 622 }
623 } 623 }
624 624
625 void TableView::OnFocus() { 625 void TableView::OnFocus() {
626 ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this); 626 ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this);
627 if (scroll_view) 627 if (scroll_view)
628 scroll_view->SetHasFocusIndicator(true); 628 scroll_view->SetHasFocusIndicator(true);
629
630 if (selection_model_.active() == -1)
sky 2017/03/23 17:50:17 && RowCount() > 0 ? Maybe add test coverage for th
Evan Stade 2017/03/23 22:56:26 I didn't add that check because I was copying Adva
631 SelectByViewIndex(0);
632
629 SchedulePaintForSelection(); 633 SchedulePaintForSelection();
630
631 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true); 634 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
632 } 635 }
633 636
634 void TableView::OnBlur() { 637 void TableView::OnBlur() {
635 ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this); 638 ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this);
636 if (scroll_view) 639 if (scroll_view)
637 scroll_view->SetHasFocusIndicator(false); 640 scroll_view->SetHasFocusIndicator(false);
638 SchedulePaintForSelection(); 641 SchedulePaintForSelection();
639 } 642 }
640 643
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 if (tooltip) 952 if (tooltip)
950 *tooltip = text; 953 *tooltip = text;
951 if (tooltip_origin) { 954 if (tooltip_origin) {
952 tooltip_origin->SetPoint(cell_bounds.x(), 955 tooltip_origin->SetPoint(cell_bounds.x(),
953 cell_bounds.y() + kTextVerticalPadding); 956 cell_bounds.y() + kTextVerticalPadding);
954 } 957 }
955 return true; 958 return true;
956 } 959 }
957 960
958 } // namespace views 961 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698