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/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.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/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 | 559 |
560 bool TaskManagerModel::GetV8Memory(int index, size_t* result) const { | 560 bool TaskManagerModel::GetV8Memory(int index, size_t* result) const { |
561 *result = 0; | 561 *result = 0; |
562 if (!resources_[index]->ReportsV8MemoryStats()) | 562 if (!resources_[index]->ReportsV8MemoryStats()) |
563 return false; | 563 return false; |
564 | 564 |
565 *result = resources_[index]->GetV8MemoryAllocated(); | 565 *result = resources_[index]->GetV8MemoryAllocated(); |
566 return true; | 566 return true; |
567 } | 567 } |
568 | 568 |
| 569 bool TaskManagerModel::CanActivate(int index) const { |
| 570 CHECK_LT(index, ResourceCount()); |
| 571 return GetResourceTabContents(index) != NULL; |
| 572 } |
| 573 |
569 bool TaskManagerModel::CanInspect(int index) const { | 574 bool TaskManagerModel::CanInspect(int index) const { |
570 CHECK_LT(index, ResourceCount()); | 575 CHECK_LT(index, ResourceCount()); |
571 return resources_[index]->CanInspect(); | 576 return resources_[index]->CanInspect(); |
572 } | 577 } |
573 | 578 |
574 void TaskManagerModel::Inspect(int index) const { | 579 void TaskManagerModel::Inspect(int index) const { |
575 CHECK_LT(index, ResourceCount()); | 580 CHECK_LT(index, ResourceCount()); |
576 resources_[index]->Inspect(); | 581 resources_[index]->Inspect(); |
577 } | 582 } |
578 | 583 |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 // Count the number of extensions with background pages (including | 1141 // Count the number of extensions with background pages (including |
1137 // incognito). | 1142 // incognito). |
1138 count += CountExtensionBackgroundPagesForProfile(profile); | 1143 count += CountExtensionBackgroundPagesForProfile(profile); |
1139 if (profile->HasOffTheRecordProfile()) { | 1144 if (profile->HasOffTheRecordProfile()) { |
1140 count += CountExtensionBackgroundPagesForProfile( | 1145 count += CountExtensionBackgroundPagesForProfile( |
1141 profile->GetOffTheRecordProfile()); | 1146 profile->GetOffTheRecordProfile()); |
1142 } | 1147 } |
1143 } | 1148 } |
1144 return count; | 1149 return count; |
1145 } | 1150 } |
OLD | NEW |