Chromium Code Reviews| 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 e4d4ae2f10b95c38dd76e4e0e1750cfc09361e8e..264c0823e5c76c06c83adb83e965daa87657e9d4 100644 |
| --- a/chrome/browser/ui/task_manager/task_manager_table_model.cc |
| +++ b/chrome/browser/ui/task_manager/task_manager_table_model.cc |
| @@ -23,6 +23,7 @@ |
| #include "components/nacl/browser/nacl_browser.h" |
| #include "components/nacl/common/nacl_switches.h" |
| #include "components/prefs/scoped_user_pref_update.h" |
| +#include "content/public/common/content_features.h" |
| #include "content/public/common/result_codes.h" |
| #include "third_party/WebKit/public/web/WebCache.h" |
| #include "ui/base/l10n/l10n_util.h" |
| @@ -143,6 +144,14 @@ class TaskManagerValuesStringifier { |
| return memory_text; |
| } |
| + base::string16 GetMemoryStateText(base::MemoryState state) { |
| + if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { |
|
afakhry
2017/01/03 18:53:17
I noticed we do this test twice; here and in TaskG
bashi
2017/01/05 00:51:49
Done.
|
| + // TODO(bashi): i18n. |
| + return base::UTF8ToUTF16(base::MemoryStateToString(state)); |
| + } |
| + return n_a_string_; |
| + } |
| + |
| base::string16 GetIdleWakeupsText(int idle_wakeups) { |
| if (idle_wakeups == -1) |
| return n_a_string_; |
| @@ -398,6 +407,11 @@ base::string16 TaskManagerTableModel::GetText(int row, int column) { |
| } |
| #endif // defined(OS_LINUX) |
| + case IDS_TASK_MANAGER_MEMORY_STATE_COLUMN: { |
| + return stringifier_->GetMemoryStateText( |
| + observed_task_manager()->GetMemoryState(tasks_[row])); |
| + } |
| + |
| default: |
| NOTREACHED(); |
| return base::string16(); |
| @@ -699,6 +713,10 @@ void TaskManagerTableModel::UpdateRefreshTypes(int column_id, bool visibility) { |
| type = REFRESH_TYPE_PRIORITY; |
| break; |
| + case IDS_TASK_MANAGER_MEMORY_STATE_COLUMN: |
| + type = REFRESH_TYPE_MEMORY_STATE; |
| + break; |
| + |
| #if defined(OS_LINUX) |
| case IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN: |
| type = REFRESH_TYPE_FD_COUNT; |