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" |
11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "chrome/browser/background/background_contents_service.h" | 18 #include "chrome/browser/background/background_contents_service.h" |
19 #include "chrome/browser/background/background_contents_service_factory.h" | 19 #include "chrome/browser/background/background_contents_service_factory.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/extensions/extension_host.h" | 21 #include "chrome/browser/extensions/extension_host.h" |
22 #include "chrome/browser/extensions/extension_process_manager.h" | 22 #include "chrome/browser/extensions/extension_process_manager.h" |
23 #include "chrome/browser/extensions/extension_system.h" | 23 #include "chrome/browser/extensions/extension_system.h" |
24 #include "chrome/browser/prefs/pref_service.h" | 24 #include "chrome/browser/prefs/pref_registry_simple.h" |
25 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
26 #include "chrome/browser/task_manager/task_manager_resource_providers.h" | 26 #include "chrome/browser/task_manager/task_manager_resource_providers.h" |
27 #include "chrome/browser/task_manager/task_manager_worker_resource_provider.h" | 27 #include "chrome/browser/task_manager/task_manager_worker_resource_provider.h" |
28 #include "chrome/browser/ui/browser_finder.h" | 28 #include "chrome/browser/ui/browser_finder.h" |
29 #include "chrome/browser/ui/browser_list.h" | 29 #include "chrome/browser/ui/browser_list.h" |
30 #include "chrome/browser/ui/browser_navigator.h" | 30 #include "chrome/browser/ui/browser_navigator.h" |
31 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
32 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
33 #include "chrome/common/view_type.h" | 33 #include "chrome/common/view_type.h" |
34 #include "content/public/browser/browser_child_process_host.h" | 34 #include "content/public/browser/browser_child_process_host.h" |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 | 1381 |
1382 bool TaskManager::Resource::CanInspect() const { return false; } | 1382 bool TaskManager::Resource::CanInspect() const { return false; } |
1383 | 1383 |
1384 content::WebContents* TaskManager::Resource::GetWebContents() const { | 1384 content::WebContents* TaskManager::Resource::GetWebContents() const { |
1385 return NULL; | 1385 return NULL; |
1386 } | 1386 } |
1387 | 1387 |
1388 bool TaskManager::Resource::IsBackground() const { return false; } | 1388 bool TaskManager::Resource::IsBackground() const { return false; } |
1389 | 1389 |
1390 // static | 1390 // static |
1391 void TaskManager::RegisterPrefs(PrefServiceSimple* prefs) { | 1391 void TaskManager::RegisterPrefs(PrefRegistrySimple* registry) { |
1392 prefs->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement); | 1392 registry->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement); |
1393 } | 1393 } |
1394 | 1394 |
1395 bool TaskManager::IsBrowserProcess(int index) const { | 1395 bool TaskManager::IsBrowserProcess(int index) const { |
1396 // If some of the selection is out of bounds, ignore. This may happen when | 1396 // If some of the selection is out of bounds, ignore. This may happen when |
1397 // killing a process that manages several pages. | 1397 // killing a process that manages several pages. |
1398 return index < model_->ResourceCount() && | 1398 return index < model_->ResourceCount() && |
1399 model_->GetProcess(index) == base::GetCurrentProcessHandle(); | 1399 model_->GetProcess(index) == base::GetCurrentProcessHandle(); |
1400 } | 1400 } |
1401 | 1401 |
1402 void TaskManager::KillProcess(int index) { | 1402 void TaskManager::KillProcess(int index) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 } | 1496 } |
1497 return count; | 1497 return count; |
1498 } | 1498 } |
1499 | 1499 |
1500 TaskManager::TaskManager() | 1500 TaskManager::TaskManager() |
1501 : ALLOW_THIS_IN_INITIALIZER_LIST(model_(new TaskManagerModel(this))) { | 1501 : ALLOW_THIS_IN_INITIALIZER_LIST(model_(new TaskManagerModel(this))) { |
1502 } | 1502 } |
1503 | 1503 |
1504 TaskManager::~TaskManager() { | 1504 TaskManager::~TaskManager() { |
1505 } | 1505 } |
OLD | NEW |