| 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 #include "chrome/browser/ui/task_manager/task_manager_columns.h" | 5 #include "chrome/browser/ui/task_manager/task_manager_columns.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 false }, | 73 false }, |
| 74 { IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN, ui::TableColumn::RIGHT, -1, 0, | 74 { IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN, ui::TableColumn::RIGHT, -1, 0, |
| 75 arraysize("idlewakeups") * kCharWidth, -1, true, false, false }, | 75 arraysize("idlewakeups") * kCharWidth, -1, true, false, false }, |
| 76 | 76 |
| 77 #if defined(OS_LINUX) | 77 #if defined(OS_LINUX) |
| 78 { IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN, ui::TableColumn::RIGHT, -1, 0, | 78 { IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN, ui::TableColumn::RIGHT, -1, 0, |
| 79 arraysize("999") * kCharWidth, -1, true, false, false }, | 79 arraysize("999") * kCharWidth, -1, true, false, false }, |
| 80 #endif // defined(OS_LINUX) | 80 #endif // defined(OS_LINUX) |
| 81 { IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN, ui::TableColumn::LEFT, -1, 0, | 81 { IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN, ui::TableColumn::LEFT, -1, 0, |
| 82 arraysize("background") * kCharWidth, -1, true, true, false }, | 82 arraysize("background") * kCharWidth, -1, true, true, false }, |
| 83 { IDS_TASK_MANAGER_MEMORY_STATE_COLUMN, ui::TableColumn::LEFT, -1, 0, |
| 84 arraysize("throttled") * kCharWidth, -1, true, false, false }, |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 const size_t kColumnsSize = arraysize(kColumns); | 87 const size_t kColumnsSize = arraysize(kColumns); |
| 86 | 88 |
| 87 const char kSortColumnIdKey[] = "sort_column_id"; | 89 const char kSortColumnIdKey[] = "sort_column_id"; |
| 88 const char kSortIsAscendingKey[] = "sort_is_ascending"; | 90 const char kSortIsAscendingKey[] = "sort_is_ascending"; |
| 89 | 91 |
| 90 // We can't use the integer IDs of the columns converted to strings as session | 92 // We can't use the integer IDs of the columns converted to strings as session |
| 91 // restore keys. These integer values can change from one build to another as | 93 // restore keys. These integer values can change from one build to another as |
| 92 // they are generated. Instead we use the literal string value of the column | 94 // they are generated. Instead we use the literal string value of the column |
| (...skipping 14 matching lines...) Expand all Loading... |
| 107 def(IDS_TASK_MANAGER_USER_HANDLES_COLUMN) \ | 109 def(IDS_TASK_MANAGER_USER_HANDLES_COLUMN) \ |
| 108 def(IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN) \ | 110 def(IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN) \ |
| 109 def(IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN) \ | 111 def(IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN) \ |
| 110 def(IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN) \ | 112 def(IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN) \ |
| 111 def(IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN) \ | 113 def(IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN) \ |
| 112 def(IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN) \ | 114 def(IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN) \ |
| 113 def(IDS_TASK_MANAGER_NACL_DEBUG_STUB_PORT_COLUMN) \ | 115 def(IDS_TASK_MANAGER_NACL_DEBUG_STUB_PORT_COLUMN) \ |
| 114 def(IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN) \ | 116 def(IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN) \ |
| 115 def(IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN) \ | 117 def(IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN) \ |
| 116 def(IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN) \ | 118 def(IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN) \ |
| 117 def(IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN) | 119 def(IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN) \ |
| 120 def(IDS_TASK_MANAGER_MEMORY_STATE_COLUMN) |
| 118 // Add to the above list in the macro any new IDs added in the future. Also | 121 // Add to the above list in the macro any new IDs added in the future. Also |
| 119 // remove the removed ones. | 122 // remove the removed ones. |
| 120 | 123 |
| 121 #define COLUMN_ID_AS_STRING(col_id) case col_id: return std::string(#col_id); | 124 #define COLUMN_ID_AS_STRING(col_id) case col_id: return std::string(#col_id); |
| 122 | 125 |
| 123 std::string GetColumnIdAsString(int column_id) { | 126 std::string GetColumnIdAsString(int column_id) { |
| 124 switch (column_id) { | 127 switch (column_id) { |
| 125 COLUMNS_LIST(COLUMN_ID_AS_STRING) | 128 COLUMNS_LIST(COLUMN_ID_AS_STRING) |
| 126 default: | 129 default: |
| 127 NOTREACHED(); | 130 NOTREACHED(); |
| 128 return std::string(); | 131 return std::string(); |
| 129 } | 132 } |
| 130 } | 133 } |
| 131 | 134 |
| 132 } // namespace task_manager | 135 } // namespace task_manager |
| OLD | NEW |