| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |