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

Unified Diff: chrome/browser/ui/task_manager/task_manager_table_model.cc

Issue 2146033003: TableView: 3-phase ToggleSortOrder (sorted/reversed/unsorted) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky's fixes. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/task_manager/task_manager_table_model.cc
diff --git a/chrome/browser/ui/task_manager/task_manager_table_model.cc b/chrome/browser/ui/task_manager/task_manager_table_model.cc
index 2cf8af172aabac5f2ec49d0dcf566e42a4fcc570..d921daa251a020ca5ad11d04971afc14ed8afd12 100644
--- a/chrome/browser/ui/task_manager/task_manager_table_model.cc
+++ b/chrome/browser/ui/task_manager/task_manager_table_model.cc
@@ -755,18 +755,8 @@ void TaskManagerTableModel::RetrieveSavedColumnsSettingsAndUpdateTable() {
if (col_visibility) {
if (sorted_col_id == col_id_key) {
- if (sort_is_ascending == kColumns[i].initial_sort_is_ascending) {
- table_view_delegate_->ToggleSortOrder(current_visible_column_index);
- } else {
- // Unfortunately the API of ui::TableView doesn't provide a clean way
- // to sort by a particular column ID and a sort direction. If the
- // retrieved sort direction is different than the initial one, we have
- // to toggle the sort order twice!
- // Note that the function takes the visible_column_index rather than
- // a column ID.
- table_view_delegate_->ToggleSortOrder(current_visible_column_index);
- table_view_delegate_->ToggleSortOrder(current_visible_column_index);
- }
+ table_view_delegate_->SetSortDescriptor(
+ TableSortDescriptor(col_id, sort_is_ascending));
}
++current_visible_column_index;
« no previous file with comments | « chrome/browser/ui/task_manager/task_manager_table_model.h ('k') | chrome/browser/ui/views/new_task_manager_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698