Chromium Code Reviews| Index: ui/views/controls/table/table_view.h |
| diff --git a/ui/views/controls/table/table_view.h b/ui/views/controls/table/table_view.h |
| index fc7f028164b02290c2163a4e74dc88f2acd65c6a..13ff7052f21bb13d0b11c80b12d39e5a9be20304 100644 |
| --- a/ui/views/controls/table/table_view.h |
| +++ b/ui/views/controls/table/table_view.h |
| @@ -154,10 +154,17 @@ class VIEWS_EXPORT TableView |
| // Sets the width of the column. |index| is in terms of |visible_columns_|. |
| void SetVisibleColumnWidth(int index, int width); |
| - // Toggles the sort order of the specified visible column index. |
| + // Modify the table sort order, depending on a clicked column and the previous |
| + // table sort order. Does nothing if this column is not sortable. |
| + // |
| + // When called repeatedly on the same sortable column, the sort order will |
| + // cycle through three states in order: sorted -> reverse-sorted -> unsorted. |
| + // When switching from one sort column to another, the previous sort column |
| + // will be remembered and used as a secondary sort key. |
| void ToggleSortOrder(int visible_column_index); |
| const SortDescriptors& sort_descriptors() const { return sort_descriptors_; } |
| + void SetSortDescriptors(SortDescriptors descriptors); |
|
sky
2016/07/18 16:18:58
nit: const SortDescriptors& . I realize what you h
ncarter (slow)
2016/07/25 20:04:01
Done.
|
| bool is_sorted() const { return !sort_descriptors_.empty(); } |
| // Maps from the index in terms of the model to that of the view. |
| @@ -227,9 +234,6 @@ class VIEWS_EXPORT TableView |
| // Invoked when the number of rows changes in some way. |
| void NumRowsChanged(); |
| - // Resets the sort descriptions. |
| - void SetSortDescriptors(const SortDescriptors& sort_descriptors); |
|
sky
2016/07/18 16:18:58
Move implementation to match new location.
ncarter (slow)
2016/07/25 20:04:01
Done.
|
| - |
| // Does the actual sort and updates the mappings (|view_to_model_| and |
| // |model_to_view_|) appropriately. |
| void SortItemsAndUpdateMapping(); |