| 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/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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 DCHECK_EQ([tableView_ numberOfRows], model_->ResourceCount()); | 169 DCHECK_EQ([tableView_ numberOfRows], model_->ResourceCount()); |
| 170 NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet]; | 170 NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet]; |
| 171 for (size_t i = 0; i < modelSelection.size(); ++i) | 171 for (size_t i = 0; i < modelSelection.size(); ++i) |
| 172 [indexSet addIndex:modelToViewMap_[modelSelection[i]]]; | 172 [indexSet addIndex:modelToViewMap_[modelSelection[i]]]; |
| 173 [tableView_ selectRowIndexes:indexSet byExtendingSelection:NO]; | 173 [tableView_ selectRowIndexes:indexSet byExtendingSelection:NO]; |
| 174 | 174 |
| 175 [tableView_ reloadData]; | 175 [tableView_ reloadData]; |
| 176 [self adjustSelectionAndEndProcessButton]; | 176 [self adjustSelectionAndEndProcessButton]; |
| 177 } | 177 } |
| 178 | 178 |
| 179 - (IBAction)statsLinkClicked:(id)sender { | |
| 180 TaskManager::GetInstance()->OpenAboutMemory(); | |
| 181 } | |
| 182 | |
| 183 - (IBAction)killSelectedProcesses:(id)sender { | 179 - (IBAction)killSelectedProcesses:(id)sender { |
| 184 NSIndexSet* selection = [tableView_ selectedRowIndexes]; | 180 NSIndexSet* selection = [tableView_ selectedRowIndexes]; |
| 185 for (NSUInteger i = [selection lastIndex]; | 181 for (NSUInteger i = [selection lastIndex]; |
| 186 i != NSNotFound; | 182 i != NSNotFound; |
| 187 i = [selection indexLessThanIndex:i]) { | 183 i = [selection indexLessThanIndex:i]) { |
| 188 taskManager_->KillProcess(viewToModelMap_[i]); | 184 taskManager_->KillProcess(viewToModelMap_[i]); |
| 189 } | 185 } |
| 190 } | 186 } |
| 191 | 187 |
| 192 - (void)selectDoubleClickedTab:(id)sender { | 188 - (void)selectDoubleClickedTab:(id)sender { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 void ShowTaskManager(Browser* browser) { | 596 void ShowTaskManager(Browser* browser) { |
| 601 TaskManagerMac::Show(); | 597 TaskManagerMac::Show(); |
| 602 } | 598 } |
| 603 | 599 |
| 604 void HideTaskManager() { | 600 void HideTaskManager() { |
| 605 TaskManagerMac::Hide(); | 601 TaskManagerMac::Hide(); |
| 606 } | 602 } |
| 607 | 603 |
| 608 } // namespace chrome | 604 } // namespace chrome |
| 609 | 605 |
| OLD | NEW |