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

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

Issue 1861383002: Add TaskManagerEndProcessEnabled policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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/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/location.h" 10 #include "base/location.h"
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 return resources_[index]; 1506 return resources_[index];
1507 } 1507 }
1508 1508
1509 //////////////////////////////////////////////////////////////////////////////// 1509 ////////////////////////////////////////////////////////////////////////////////
1510 // TaskManager class 1510 // TaskManager class
1511 //////////////////////////////////////////////////////////////////////////////// 1511 ////////////////////////////////////////////////////////////////////////////////
1512 // static 1512 // static
1513 void TaskManager::RegisterPrefs(PrefRegistrySimple* registry) { 1513 void TaskManager::RegisterPrefs(PrefRegistrySimple* registry) {
1514 registry->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement); 1514 registry->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement);
1515 registry->RegisterDictionaryPref(prefs::kTaskManagerColumnVisibility); 1515 registry->RegisterDictionaryPref(prefs::kTaskManagerColumnVisibility);
1516 registry->RegisterBooleanPref(prefs::kTaskManagerEndProcessEnabled, true);
1517 }
1518
1519 // static
1520 bool TaskManager::IsEndProcessEnabled() {
1521 return g_browser_process->local_state()->GetBoolean(prefs::kTaskManagerEndProc essEnabled);
1516 } 1522 }
1517 1523
1518 bool TaskManager::IsBrowserProcess(int index) const { 1524 bool TaskManager::IsBrowserProcess(int index) const {
1519 // If some of the selection is out of bounds, ignore. This may happen when 1525 // If some of the selection is out of bounds, ignore. This may happen when
1520 // killing a process that manages several pages. 1526 // killing a process that manages several pages.
1521 return index < model_->ResourceCount() && 1527 return index < model_->ResourceCount() &&
1522 model_->GetProcess(index) == base::GetCurrentProcessHandle(); 1528 model_->GetProcess(index) == base::GetCurrentProcessHandle();
1523 } 1529 }
1524 1530
1525 void TaskManager::KillProcess(int index) { 1531 void TaskManager::KillProcess(int index) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 TaskManager* TaskManager::GetInstance() { 1568 TaskManager* TaskManager::GetInstance() {
1563 return base::Singleton<TaskManager>::get(); 1569 return base::Singleton<TaskManager>::get();
1564 } 1570 }
1565 1571
1566 TaskManager::TaskManager() 1572 TaskManager::TaskManager()
1567 : model_(new TaskManagerModel(this)) { 1573 : model_(new TaskManagerModel(this)) {
1568 } 1574 }
1569 1575
1570 TaskManager::~TaskManager() { 1576 TaskManager::~TaskManager() {
1571 } 1577 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698