| 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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 // static | 1126 // static |
| 1127 TaskManager* TaskManager::GetInstance() { | 1127 TaskManager* TaskManager::GetInstance() { |
| 1128 return Singleton<TaskManager>::get(); | 1128 return Singleton<TaskManager>::get(); |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 void TaskManager::OpenAboutMemory() { | 1131 void TaskManager::OpenAboutMemory() { |
| 1132 Browser* browser = browser::FindOrCreateTabbedBrowser( | 1132 Browser* browser = browser::FindOrCreateTabbedBrowser( |
| 1133 ProfileManager::GetDefaultProfileOrOffTheRecord()); | 1133 ProfileManager::GetDefaultProfileOrOffTheRecord()); |
| 1134 browser::NavigateParams params(browser, | 1134 chrome::NavigateParams params(browser, GURL(chrome::kChromeUIMemoryURL), |
| 1135 GURL(chrome::kChromeUIMemoryURL), | 1135 content::PAGE_TRANSITION_LINK); |
| 1136 content::PAGE_TRANSITION_LINK); | |
| 1137 params.disposition = NEW_FOREGROUND_TAB; | 1136 params.disposition = NEW_FOREGROUND_TAB; |
| 1138 browser::Navigate(¶ms); | 1137 chrome::Navigate(¶ms); |
| 1139 } | 1138 } |
| 1140 | 1139 |
| 1141 bool TaskManagerModel::GetAndCacheMemoryMetrics(base::ProcessHandle handle, | 1140 bool TaskManagerModel::GetAndCacheMemoryMetrics(base::ProcessHandle handle, |
| 1142 MemoryUsageEntry* usage) const { | 1141 MemoryUsageEntry* usage) const { |
| 1143 MetricsMap::const_iterator iter = metrics_map_.find(handle); | 1142 MetricsMap::const_iterator iter = metrics_map_.find(handle); |
| 1144 if (iter == metrics_map_.end()) | 1143 if (iter == metrics_map_.end()) |
| 1145 return false; | 1144 return false; |
| 1146 | 1145 |
| 1147 if (!iter->second->GetMemoryBytes(&usage->first, &usage->second)) | 1146 if (!iter->second->GetMemoryBytes(&usage->first, &usage->second)) |
| 1148 return false; | 1147 return false; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 // Count the number of extensions with background pages (including | 1192 // Count the number of extensions with background pages (including |
| 1194 // incognito). | 1193 // incognito). |
| 1195 count += CountExtensionBackgroundPagesForProfile(profile); | 1194 count += CountExtensionBackgroundPagesForProfile(profile); |
| 1196 if (profile->HasOffTheRecordProfile()) { | 1195 if (profile->HasOffTheRecordProfile()) { |
| 1197 count += CountExtensionBackgroundPagesForProfile( | 1196 count += CountExtensionBackgroundPagesForProfile( |
| 1198 profile->GetOffTheRecordProfile()); | 1197 profile->GetOffTheRecordProfile()); |
| 1199 } | 1198 } |
| 1200 } | 1199 } |
| 1201 return count; | 1200 return count; |
| 1202 } | 1201 } |
| OLD | NEW |