| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webui/task_manager_handler.h" | 5 #include "chrome/browser/ui/webui/task_manager_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 std::pair<int, int> group_range; | 134 std::pair<int, int> group_range; |
| 135 group_range = tm->GetGroupRangeForResource(index); | 135 group_range = tm->GetGroupRangeForResource(index); |
| 136 int length = group_range.second; | 136 int length = group_range.second; |
| 137 | 137 |
| 138 val->SetInteger("index", index); | 138 val->SetInteger("index", index); |
| 139 val->SetInteger("group_range_start", group_range.first); | 139 val->SetInteger("group_range_start", group_range.first); |
| 140 val->SetInteger("group_range_length", group_range.second); | 140 val->SetInteger("group_range_length", group_range.second); |
| 141 val->SetInteger("index_in_group", index - group_range.first); | 141 val->SetInteger("index_in_group", index - group_range.first); |
| 142 val->SetBoolean("is_resource_first_in_group", | 142 val->SetBoolean("is_resource_first_in_group", |
| 143 tm->IsResourceFirstInGroup(index)); | 143 tm->IsResourceFirstInGroup(index)); |
| 144 val->SetBoolean("isBackgroundResource", |
| 145 tm->IsBackgroundResource(index)); |
| 144 | 146 |
| 145 // Columns which have one datum in each group. | 147 // Columns which have one datum in each group. |
| 146 CreateGroupColumnList(tm, "processId", index, 1, val); | 148 CreateGroupColumnList(tm, "processId", index, 1, val); |
| 147 CreateGroupColumnList(tm, "processIdValue", index, 1, val); | 149 CreateGroupColumnList(tm, "processIdValue", index, 1, val); |
| 148 CreateGroupColumnList(tm, "cpuUsage", index, 1, val); | 150 CreateGroupColumnList(tm, "cpuUsage", index, 1, val); |
| 149 CreateGroupColumnList(tm, "cpuUsageValue", index, 1, val); | 151 CreateGroupColumnList(tm, "cpuUsageValue", index, 1, val); |
| 150 CreateGroupColumnList(tm, "physicalMemory", index, 1, val); | 152 CreateGroupColumnList(tm, "physicalMemory", index, 1, val); |
| 151 CreateGroupColumnList(tm, "physicalMemoryValue", index, 1, val); | 153 CreateGroupColumnList(tm, "physicalMemoryValue", index, 1, val); |
| 152 CreateGroupColumnList(tm, "sharedMemory", index, 1, val); | 154 CreateGroupColumnList(tm, "sharedMemory", index, 1, val); |
| 153 CreateGroupColumnList(tm, "sharedMemoryValue", index, 1, val); | 155 CreateGroupColumnList(tm, "sharedMemoryValue", index, 1, val); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 } | 400 } |
| 399 | 401 |
| 400 void TaskManagerHandler::OnGroupRemoved(const int group_start, | 402 void TaskManagerHandler::OnGroupRemoved(const int group_start, |
| 401 const int group_length) { | 403 const int group_length) { |
| 402 FundamentalValue start_value(group_start); | 404 FundamentalValue start_value(group_start); |
| 403 FundamentalValue length_value(group_length); | 405 FundamentalValue length_value(group_length); |
| 404 if (is_enabled_) | 406 if (is_enabled_) |
| 405 web_ui_->CallJavascriptFunction("taskRemoved", start_value, length_value); | 407 web_ui_->CallJavascriptFunction("taskRemoved", start_value, length_value); |
| 406 } | 408 } |
| 407 | 409 |
| OLD | NEW |