| 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/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/i18n/number_formatting.h" | 8 #include "base/i18n/number_formatting.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 return false; | 693 return false; |
| 694 *result = GetPerResourceValues(index).v8_memory_used; | 694 *result = GetPerResourceValues(index).v8_memory_used; |
| 695 return true; | 695 return true; |
| 696 } | 696 } |
| 697 | 697 |
| 698 bool TaskManagerModel::CanActivate(int index) const { | 698 bool TaskManagerModel::CanActivate(int index) const { |
| 699 CHECK_LT(index, ResourceCount()); | 699 CHECK_LT(index, ResourceCount()); |
| 700 return GetResourceWebContents(index) != NULL; | 700 return GetResourceWebContents(index) != NULL; |
| 701 } | 701 } |
| 702 | 702 |
| 703 bool TaskManagerModel::CanInspect(int index) const { | |
| 704 return GetResource(index)->CanInspect(); | |
| 705 } | |
| 706 | |
| 707 void TaskManagerModel::Inspect(int index) const { | |
| 708 CHECK_LT(index, ResourceCount()); | |
| 709 GetResource(index)->Inspect(); | |
| 710 } | |
| 711 | |
| 712 int TaskManagerModel::GetGoatsTeleported(int index) const { | 703 int TaskManagerModel::GetGoatsTeleported(int index) const { |
| 713 PerResourceValues& values(GetPerResourceValues(index)); | 704 PerResourceValues& values(GetPerResourceValues(index)); |
| 714 if (!values.is_goats_teleported_valid) { | 705 if (!values.is_goats_teleported_valid) { |
| 715 values.is_goats_teleported_valid = true; | 706 values.is_goats_teleported_valid = true; |
| 716 values.goats_teleported = goat_salt_ * (index + 1); | 707 values.goats_teleported = goat_salt_ * (index + 1); |
| 717 values.goats_teleported = (values.goats_teleported >> 16) & 255; | 708 values.goats_teleported = (values.goats_teleported >> 16) & 255; |
| 718 } | 709 } |
| 719 return values.goats_teleported; | 710 return values.goats_teleported; |
| 720 } | 711 } |
| 721 | 712 |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 params.host_desktop_type = desktop_type; | 1544 params.host_desktop_type = desktop_type; |
| 1554 chrome::Navigate(¶ms); | 1545 chrome::Navigate(¶ms); |
| 1555 } | 1546 } |
| 1556 | 1547 |
| 1557 TaskManager::TaskManager() | 1548 TaskManager::TaskManager() |
| 1558 : model_(new TaskManagerModel(this)) { | 1549 : model_(new TaskManagerModel(this)) { |
| 1559 } | 1550 } |
| 1560 | 1551 |
| 1561 TaskManager::~TaskManager() { | 1552 TaskManager::~TaskManager() { |
| 1562 } | 1553 } |
| OLD | NEW |