| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_UI_TASK_MANAGER_TASK_MANAGER_TABLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TASK_MANAGER_TASK_MANAGER_TABLE_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TASK_MANAGER_TASK_MANAGER_TABLE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TASK_MANAGER_TASK_MANAGER_TABLE_MODEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/task_management/task_manager_observer.h" | 14 #include "chrome/browser/task_management/task_manager_observer.h" |
| 15 #include "ui/base/models/table_model.h" | 15 #include "ui/base/models/table_model.h" |
| 16 | 16 |
| 17 namespace content { |
| 18 class WebContents; |
| 19 } |
| 20 |
| 17 namespace task_management { | 21 namespace task_management { |
| 18 | 22 |
| 19 class TaskManagerValuesStringifier; | 23 class TaskManagerValuesStringifier; |
| 20 | 24 |
| 21 // Describes how the platform specific table view is sorted. | 25 // Describes how the platform specific table view is sorted. |
| 22 struct TableSortDescriptor { | 26 struct TableSortDescriptor { |
| 23 TableSortDescriptor(); | 27 TableSortDescriptor(); |
| 24 TableSortDescriptor(int col_id, bool ascending); | 28 TableSortDescriptor(int col_id, bool ascending); |
| 25 | 29 |
| 26 // The ID of the sorted column, -1 if the table is not sorted. | 30 // The ID of the sorted column, -1 if the table is not sorted. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Restores the saved columns settings from a previous session into | 96 // Restores the saved columns settings from a previous session into |
| 93 // |columns_settings_| and updates the table view. | 97 // |columns_settings_| and updates the table view. |
| 94 void RetrieveSavedColumnsSettingsAndUpdateTable(); | 98 void RetrieveSavedColumnsSettingsAndUpdateTable(); |
| 95 | 99 |
| 96 // Stores the current values in |column_settings_| to the user prefs so that | 100 // Stores the current values in |column_settings_| to the user prefs so that |
| 97 // it can be restored later next time the task manager view is opened. | 101 // it can be restored later next time the task manager view is opened. |
| 98 void StoreColumnsSettings(); | 102 void StoreColumnsSettings(); |
| 99 | 103 |
| 100 void ToggleColumnVisibility(int column_id); | 104 void ToggleColumnVisibility(int column_id); |
| 101 | 105 |
| 106 // Returns the row index corresponding to a particular WebContents. Returns -1 |
| 107 // if |web_contents| is nullptr, or is not currently found in the model (for |
| 108 // example, if the tab is currently crashed). |
| 109 int GetRowForWebContents(content::WebContents* web_contents); |
| 110 |
| 102 private: | 111 private: |
| 103 friend class TaskManagerTesterImpl; | 112 friend class TaskManagerTesterImpl; |
| 104 | 113 |
| 105 // Start / stop observing the task manager. | 114 // Start / stop observing the task manager. |
| 106 void StartUpdating(); | 115 void StartUpdating(); |
| 107 void StopUpdating(); | 116 void StopUpdating(); |
| 108 | 117 |
| 109 void OnRefresh(); | 118 void OnRefresh(); |
| 110 | 119 |
| 111 // Checks whether the task at |row_index| is the first task in its process | 120 // Checks whether the task at |row_index| is the first task in its process |
| (...skipping 23 matching lines...) Expand all Loading... |
| 135 | 144 |
| 136 // The status of the flag #enable-nacl-debug. | 145 // The status of the flag #enable-nacl-debug. |
| 137 bool is_nacl_debugging_flag_enabled_; | 146 bool is_nacl_debugging_flag_enabled_; |
| 138 | 147 |
| 139 DISALLOW_COPY_AND_ASSIGN(TaskManagerTableModel); | 148 DISALLOW_COPY_AND_ASSIGN(TaskManagerTableModel); |
| 140 }; | 149 }; |
| 141 | 150 |
| 142 } // namespace task_management | 151 } // namespace task_management |
| 143 | 152 |
| 144 #endif // CHROME_BROWSER_UI_TASK_MANAGER_TASK_MANAGER_TABLE_MODEL_H_ | 153 #endif // CHROME_BROWSER_UI_TASK_MANAGER_TASK_MANAGER_TABLE_MODEL_H_ |
| OLD | NEW |