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

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

Issue 1722493002: Project Eraser: Kill chrome://memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chrome_browser_ui.gypi. Created 4 years, 9 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/task_manager_mac.h ('k') | chrome/browser/ui/views/new_task_manager_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698