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

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

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/cocoa_test_helper.mm ('k') | chrome/browser/ui/gtk/dialogs_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 i = [viewSelection indexLessThanIndex:i]) { 154 i = [viewSelection indexLessThanIndex:i]) {
155 modelSelection.push_back(viewToModelMap_[i]); 155 modelSelection.push_back(viewToModelMap_[i]);
156 } 156 }
157 157
158 // Sort. 158 // Sort.
159 [self sortShuffleArray]; 159 [self sortShuffleArray];
160 160
161 // Use the model indices to get the new view indices of the selection, and 161 // Use the model indices to get the new view indices of the selection, and
162 // set selection to that. This assumes that no rows were added or removed 162 // set selection to that. This assumes that no rows were added or removed
163 // (in that case, the selection is cleared before -reloadData is called). 163 // (in that case, the selection is cleared before -reloadData is called).
164 if (modelSelection.size() > 0) 164 if (!modelSelection.empty())
165 DCHECK_EQ([tableView_ numberOfRows], model_->ResourceCount()); 165 DCHECK_EQ([tableView_ numberOfRows], model_->ResourceCount());
166 NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet]; 166 NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet];
167 for (size_t i = 0; i < modelSelection.size(); ++i) 167 for (size_t i = 0; i < modelSelection.size(); ++i)
168 [indexSet addIndex:modelToViewMap_[modelSelection[i]]]; 168 [indexSet addIndex:modelToViewMap_[modelSelection[i]]];
169 [tableView_ selectRowIndexes:indexSet byExtendingSelection:NO]; 169 [tableView_ selectRowIndexes:indexSet byExtendingSelection:NO];
170 170
171 [tableView_ reloadData]; 171 [tableView_ reloadData];
172 [self adjustSelectionAndEndProcessButton]; 172 [self adjustSelectionAndEndProcessButton];
173 } 173 }
174 174
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 // "Task Manager" so close the existing window and fall through to 626 // "Task Manager" so close the existing window and fall through to
627 // open a new one. 627 // open a new one.
628 [[instance_->window_controller_ window] close]; 628 [[instance_->window_controller_ window] close];
629 } 629 }
630 } 630 }
631 // Create a new instance. 631 // Create a new instance.
632 instance_ = new TaskManagerMac(TaskManager::GetInstance(), 632 instance_ = new TaskManagerMac(TaskManager::GetInstance(),
633 highlight_background_resources); 633 highlight_background_resources);
634 instance_->model_->StartUpdating(); 634 instance_->model_->StartUpdating();
635 } 635 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/cocoa_test_helper.mm ('k') | chrome/browser/ui/gtk/dialogs_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698