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

Side by Side Diff: chrome/browser/ui/cocoa/task_manager_mac.mm

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/ui/cocoa/task_manager_mac.h" 5 #include "chrome/browser/ui/cocoa/task_manager_mac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 selectionContainsBrowserProcess = true; 404 selectionContainsBrowserProcess = true;
405 405
406 TaskManagerModel::GroupRange rangePair = 406 TaskManagerModel::GroupRange rangePair =
407 model_->GetGroupRangeForResource(modelIndex); 407 model_->GetGroupRangeForResource(modelIndex);
408 NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet]; 408 NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet];
409 for (int j = 0; j < rangePair.second; ++j) 409 for (int j = 0; j < rangePair.second; ++j)
410 [indexSet addIndex:modelToViewMap_[rangePair.first + j]]; 410 [indexSet addIndex:modelToViewMap_[rangePair.first + j]];
411 [tableView_ selectRowIndexes:indexSet byExtendingSelection:YES]; 411 [tableView_ selectRowIndexes:indexSet byExtendingSelection:YES];
412 } 412 }
413 413
414 bool enabled = [selection count] > 0 && !selectionContainsBrowserProcess; 414 bool enabled = [selection count] > 0 && !selectionContainsBrowserProcess &&
415 TaskManager::IsEndProcessEnabled();
415 [endProcessButton_ setEnabled:enabled]; 416 [endProcessButton_ setEnabled:enabled];
416 } 417 }
417 418
418 - (void)deselectRows { 419 - (void)deselectRows {
419 [tableView_ deselectAll:self]; 420 [tableView_ deselectAll:self];
420 } 421 }
421 422
422 // Table view delegate methods. 423 // Table view delegate methods.
423 424
424 // The selection is being changed by mouse (drag/click). 425 // The selection is being changed by mouse (drag/click).
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 void ShowTaskManager(Browser* browser) { 597 void ShowTaskManager(Browser* browser) {
597 TaskManagerMac::Show(); 598 TaskManagerMac::Show();
598 } 599 }
599 600
600 void HideTaskManager() { 601 void HideTaskManager() {
601 TaskManagerMac::Hide(); 602 TaskManagerMac::Hide();
602 } 603 }
603 604
604 } // namespace chrome 605 } // namespace chrome
605 606
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698