| 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 if (event->type() != ui::ET_GESTURE_TAP) | 412 if (event->type() != ui::ET_GESTURE_TAP_DOWN) |
| 413 return; | 413 return; |
| 414 | 414 |
| 415 RequestFocus(); |
| 416 |
| 415 const int row = event->y() / row_height_; | 417 const int row = event->y() / row_height_; |
| 416 if (row < 0 || row >= RowCount()) | 418 if (row < 0 || row >= RowCount()) |
| 417 return; | 419 return; |
| 418 | 420 |
| 419 event->StopPropagation(); | 421 event->StopPropagation(); |
| 420 ui::ListSelectionModel new_model; | 422 ui::ListSelectionModel new_model; |
| 421 ConfigureSelectionModelForEvent(*event, &new_model); | 423 ConfigureSelectionModelForEvent(*event, &new_model); |
| 422 SetSelectionModel(new_model); | 424 SetSelectionModel(new_model); |
| 423 } | 425 } |
| 424 | 426 |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 if (tooltip) | 949 if (tooltip) |
| 948 *tooltip = text; | 950 *tooltip = text; |
| 949 if (tooltip_origin) { | 951 if (tooltip_origin) { |
| 950 tooltip_origin->SetPoint(cell_bounds.x(), | 952 tooltip_origin->SetPoint(cell_bounds.x(), |
| 951 cell_bounds.y() + kTextVerticalPadding); | 953 cell_bounds.y() + kTextVerticalPadding); |
| 952 } | 954 } |
| 953 return true; | 955 return true; |
| 954 } | 956 } |
| 955 | 957 |
| 956 } // namespace views | 958 } // namespace views |
| OLD | NEW |