Chromium Code Reviews| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 } else if (event.GetClickCount() == 1) { | 402 } else if (event.GetClickCount() == 1) { |
| 403 ui::ListSelectionModel new_model; | 403 ui::ListSelectionModel new_model; |
| 404 ConfigureSelectionModelForEvent(event, &new_model); | 404 ConfigureSelectionModelForEvent(event, &new_model); |
| 405 SetSelectionModel(new_model); | 405 SetSelectionModel(new_model); |
| 406 } | 406 } |
| 407 | 407 |
| 408 return true; | 408 return true; |
| 409 } | 409 } |
| 410 | 410 |
| 411 void TableView::OnGestureEvent(ui::GestureEvent* event) { | 411 void TableView::OnGestureEvent(ui::GestureEvent* event) { |
| 412 RequestFocus(); | |
|
sky
2017/03/28 17:41:24
Should we only request focus on ET_GESTURE_TAP_DOW
Evan Stade
2017/03/28 17:43:17
I am hoping Terry knows what the standard behavior
tdanderson
2017/03/28 21:26:22
Doing a quick audit of other surfaces it doesn't l
| |
| 412 if (event->type() != ui::ET_GESTURE_TAP) | 413 if (event->type() != ui::ET_GESTURE_TAP) |
| 413 return; | 414 return; |
| 414 | 415 |
| 415 const int row = event->y() / row_height_; | 416 const int row = event->y() / row_height_; |
| 416 if (row < 0 || row >= RowCount()) | 417 if (row < 0 || row >= RowCount()) |
| 417 return; | 418 return; |
| 418 | 419 |
| 419 event->StopPropagation(); | 420 event->StopPropagation(); |
| 420 ui::ListSelectionModel new_model; | 421 ui::ListSelectionModel new_model; |
| 421 ConfigureSelectionModelForEvent(*event, &new_model); | 422 ConfigureSelectionModelForEvent(*event, &new_model); |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 950 if (tooltip) | 951 if (tooltip) |
| 951 *tooltip = text; | 952 *tooltip = text; |
| 952 if (tooltip_origin) { | 953 if (tooltip_origin) { |
| 953 tooltip_origin->SetPoint(cell_bounds.x(), | 954 tooltip_origin->SetPoint(cell_bounds.x(), |
| 954 cell_bounds.y() + kTextVerticalPadding); | 955 cell_bounds.y() + kTextVerticalPadding); |
| 955 } | 956 } |
| 956 return true; | 957 return true; |
| 957 } | 958 } |
| 958 | 959 |
| 959 } // namespace views | 960 } // namespace views |
| OLD | NEW |