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

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

Issue 2780833004: Improve TableView unit tests and fix bugs that were uncovered. (Closed)
Patch Set: disable for now on mac Created 3 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
« no previous file with comments | « no previous file | ui/views/controls/table/table_view_unittest.cc » ('j') | 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/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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 kGroupingIndicatorSize / 2, grouping_flags); 618 kGroupingIndicatorSize / 2, grouping_flags);
619 i = last + 1; 619 i = last + 1;
620 } 620 }
621 } 621 }
622 622
623 void TableView::OnFocus() { 623 void TableView::OnFocus() {
624 ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this); 624 ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this);
625 if (scroll_view) 625 if (scroll_view)
626 scroll_view->SetHasFocusIndicator(true); 626 scroll_view->SetHasFocusIndicator(true);
627 627
628 if (selection_model_.active() == -1 && RowCount())
629 SelectByViewIndex(0);
630
631 SchedulePaintForSelection(); 628 SchedulePaintForSelection();
632 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true); 629 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
633 } 630 }
634 631
635 void TableView::OnBlur() { 632 void TableView::OnBlur() {
636 ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this); 633 ScrollView* scroll_view = ScrollView::GetScrollViewForContents(this);
637 if (scroll_view) 634 if (scroll_view)
638 scroll_view->SetHasFocusIndicator(false); 635 scroll_view->SetHasFocusIndicator(false);
639 SchedulePaintForSelection(); 636 SchedulePaintForSelection();
640 } 637 }
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 if (tooltip) 947 if (tooltip)
951 *tooltip = text; 948 *tooltip = text;
952 if (tooltip_origin) { 949 if (tooltip_origin) {
953 tooltip_origin->SetPoint(cell_bounds.x(), 950 tooltip_origin->SetPoint(cell_bounds.x(),
954 cell_bounds.y() + kTextVerticalPadding); 951 cell_bounds.y() + kTextVerticalPadding);
955 } 952 }
956 return true; 953 return true;
957 } 954 }
958 955
959 } // namespace views 956 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/table/table_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698