OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/task_manager_handler.h" | 5 #include "chrome/browser/ui/webui/task_manager/task_manager_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 base::DictionaryValue* TaskManagerHandler::CreateTaskGroupValue( | 257 base::DictionaryValue* TaskManagerHandler::CreateTaskGroupValue( |
258 int group_index) { | 258 int group_index) { |
259 DictionaryValue* val = new DictionaryValue(); | 259 DictionaryValue* val = new DictionaryValue(); |
260 | 260 |
261 if (group_index >= model_->GroupCount()) | 261 if (group_index >= model_->GroupCount()) |
262 return val; | 262 return val; |
263 | 263 |
264 int index = model_->GetResourceIndexForGroup(group_index, 0); | 264 int index = model_->GetResourceIndexForGroup(group_index, 0); |
265 int length = model_->GetGroupRangeForResource(index).second; | 265 int length = model_->GetGroupRangeForResource(index).second; |
266 | 266 |
267 // Forces to set following 3 columns regardless of |enable_columns|. | 267 // Forces to set following column regardless of |enable_columns|. |
268 val->SetInteger("index", index); | 268 val->SetInteger("index", index); |
269 val->SetBoolean("isBackgroundResource", | |
270 model_->IsBackgroundResource(index)); | |
271 CreateGroupColumnList("processId", index, 1, val); | 269 CreateGroupColumnList("processId", index, 1, val); |
272 CreateGroupColumnList("type", index, length, val); | 270 CreateGroupColumnList("type", index, length, val); |
273 CreateGroupColumnList("uniqueId", index, length, val); | 271 CreateGroupColumnList("uniqueId", index, length, val); |
274 | 272 |
275 for (size_t i = 0; i < arraysize(kColumnsList); ++i) { | 273 for (size_t i = 0; i < arraysize(kColumnsList); ++i) { |
276 const std::string column_id = kColumnsList[i].column_id; | 274 const std::string column_id = kColumnsList[i].column_id; |
277 | 275 |
278 if (enabled_columns_.find(column_id) == enabled_columns_.end()) | 276 if (enabled_columns_.find(column_id) == enabled_columns_.end()) |
279 continue; | 277 continue; |
280 | 278 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 return Value::CreateDoubleValue(v8_memory); | 417 return Value::CreateDoubleValue(v8_memory); |
420 } | 418 } |
421 if (column_name == "canInspect") | 419 if (column_name == "canInspect") |
422 return Value::CreateBooleanValue(model_->CanInspect(i)); | 420 return Value::CreateBooleanValue(model_->CanInspect(i)); |
423 if (column_name == "canActivate") | 421 if (column_name == "canActivate") |
424 return Value::CreateBooleanValue(model_->CanActivate(i)); | 422 return Value::CreateBooleanValue(model_->CanActivate(i)); |
425 | 423 |
426 NOTREACHED(); | 424 NOTREACHED(); |
427 return NULL; | 425 return NULL; |
428 } | 426 } |
OLD | NEW |