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

Side by Side Diff: chrome/browser/ui/views/task_manager_view.cc

Issue 1861383002: Add TaskManagerEndProcessEnabled policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update supported_on to 52 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 const ui::ListSelectionModel::SelectedIndices& selection( 529 const ui::ListSelectionModel::SelectedIndices& selection(
530 tab_table_->selection_model().selected_indices()); 530 tab_table_->selection_model().selected_indices());
531 bool selection_contains_browser_process = false; 531 bool selection_contains_browser_process = false;
532 for (size_t i = 0; i < selection.size(); ++i) { 532 for (size_t i = 0; i < selection.size(); ++i) {
533 if (task_manager_->IsBrowserProcess(selection[i])) { 533 if (task_manager_->IsBrowserProcess(selection[i])) {
534 selection_contains_browser_process = true; 534 selection_contains_browser_process = true;
535 break; 535 break;
536 } 536 }
537 } 537 }
538 kill_button_->SetEnabled(!selection_contains_browser_process && 538 kill_button_->SetEnabled(!selection_contains_browser_process &&
539 !selection.empty()); 539 !selection.empty() &&
540 TaskManager::IsEndProcessEnabled());
540 } 541 }
541 542
542 void TaskManagerView::OnDoubleClick() { 543 void TaskManagerView::OnDoubleClick() {
543 ActivateFocusedTab(); 544 ActivateFocusedTab();
544 } 545 }
545 546
546 void TaskManagerView::OnKeyDown(ui::KeyboardCode keycode) { 547 void TaskManagerView::OnKeyDown(ui::KeyboardCode keycode) {
547 if (keycode == ui::VKEY_RETURN) 548 if (keycode == ui::VKEY_RETURN)
548 ActivateFocusedTab(); 549 ActivateFocusedTab();
549 } 550 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 void HideTaskManager() { 625 void HideTaskManager() {
625 if (switches::NewTaskManagerEnabled()) { 626 if (switches::NewTaskManagerEnabled()) {
626 task_management::NewTaskManagerView::Hide(); 627 task_management::NewTaskManagerView::Hide();
627 return; 628 return;
628 } 629 }
629 630
630 TaskManagerView::Hide(); 631 TaskManagerView::Hide();
631 } 632 }
632 633
633 } // namespace chrome 634 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698