Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/browser/task_manager/task_manager.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Fix Clang build and fix bug shown by trybots. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_registry_simple.h"
24 #include "chrome/browser/prefs/pref_service.h" 25 #include "chrome/browser/prefs/pref_service.h"
Mattias Nissler (ping if slow) 2013/01/31 14:50:45 needed?
Jói 2013/01/31 16:23:37 Done.
25 #include "chrome/browser/profiles/profile_manager.h" 26 #include "chrome/browser/profiles/profile_manager.h"
26 #include "chrome/browser/task_manager/task_manager_resource_providers.h" 27 #include "chrome/browser/task_manager/task_manager_resource_providers.h"
27 #include "chrome/browser/task_manager/task_manager_worker_resource_provider.h" 28 #include "chrome/browser/task_manager/task_manager_worker_resource_provider.h"
28 #include "chrome/browser/ui/browser_finder.h" 29 #include "chrome/browser/ui/browser_finder.h"
29 #include "chrome/browser/ui/browser_list.h" 30 #include "chrome/browser/ui/browser_list.h"
30 #include "chrome/browser/ui/browser_navigator.h" 31 #include "chrome/browser/ui/browser_navigator.h"
31 #include "chrome/common/pref_names.h" 32 #include "chrome/common/pref_names.h"
32 #include "chrome/common/url_constants.h" 33 #include "chrome/common/url_constants.h"
33 #include "chrome/common/view_type.h" 34 #include "chrome/common/view_type.h"
34 #include "content/public/browser/browser_child_process_host.h" 35 #include "content/public/browser/browser_child_process_host.h"
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 1382
1382 bool TaskManager::Resource::CanInspect() const { return false; } 1383 bool TaskManager::Resource::CanInspect() const { return false; }
1383 1384
1384 content::WebContents* TaskManager::Resource::GetWebContents() const { 1385 content::WebContents* TaskManager::Resource::GetWebContents() const {
1385 return NULL; 1386 return NULL;
1386 } 1387 }
1387 1388
1388 bool TaskManager::Resource::IsBackground() const { return false; } 1389 bool TaskManager::Resource::IsBackground() const { return false; }
1389 1390
1390 // static 1391 // static
1391 void TaskManager::RegisterPrefs(PrefServiceSimple* prefs) { 1392 void TaskManager::RegisterPrefs(PrefRegistrySimple* registry) {
1392 prefs->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement); 1393 registry->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement);
1393 } 1394 }
1394 1395
1395 bool TaskManager::IsBrowserProcess(int index) const { 1396 bool TaskManager::IsBrowserProcess(int index) const {
1396 // If some of the selection is out of bounds, ignore. This may happen when 1397 // If some of the selection is out of bounds, ignore. This may happen when
1397 // killing a process that manages several pages. 1398 // killing a process that manages several pages.
1398 return index < model_->ResourceCount() && 1399 return index < model_->ResourceCount() &&
1399 model_->GetProcess(index) == base::GetCurrentProcessHandle(); 1400 model_->GetProcess(index) == base::GetCurrentProcessHandle();
1400 } 1401 }
1401 1402
1402 void TaskManager::KillProcess(int index) { 1403 void TaskManager::KillProcess(int index) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 } 1497 }
1497 return count; 1498 return count;
1498 } 1499 }
1499 1500
1500 TaskManager::TaskManager() 1501 TaskManager::TaskManager()
1501 : ALLOW_THIS_IN_INITIALIZER_LIST(model_(new TaskManagerModel(this))) { 1502 : ALLOW_THIS_IN_INITIALIZER_LIST(model_(new TaskManagerModel(this))) {
1502 } 1503 }
1503 1504
1504 TaskManager::~TaskManager() { 1505 TaskManager::~TaskManager() {
1505 } 1506 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698