| OLD | NEW |
| 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/cocoa/task_manager_mac.h" | 5 #include "chrome/browser/cocoa/task_manager_mac.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util_mac.h" | 10 #include "app/l10n_util_mac.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 - (void)awakeFromNib { | 189 - (void)awakeFromNib { |
| 190 [self setUpTableColumns]; | 190 [self setUpTableColumns]; |
| 191 [self setUpTableHeaderContextMenu]; | 191 [self setUpTableHeaderContextMenu]; |
| 192 [self adjustSelectionAndEndProcessButton]; | 192 [self adjustSelectionAndEndProcessButton]; |
| 193 | 193 |
| 194 [tableView_ setDoubleAction:@selector(selectDoubleClickedTab:)]; | 194 [tableView_ setDoubleAction:@selector(selectDoubleClickedTab:)]; |
| 195 [tableView_ sizeToFit]; | 195 [tableView_ sizeToFit]; |
| 196 } | 196 } |
| 197 | 197 |
| 198 - (void)dealloc { |
| 199 [tableView_ setDelegate:nil]; |
| 200 [tableView_ setDataSource:nil]; |
| 201 [super dealloc]; |
| 202 } |
| 203 |
| 198 // Adds a column which has the given string id as title. |isVisible| specifies | 204 // Adds a column which has the given string id as title. |isVisible| specifies |
| 199 // if the column is initially visible. | 205 // if the column is initially visible. |
| 200 - (NSTableColumn*)addColumnWithId:(int)columnId visible:(BOOL)isVisible { | 206 - (NSTableColumn*)addColumnWithId:(int)columnId visible:(BOOL)isVisible { |
| 201 scoped_nsobject<NSTableColumn> column([[NSTableColumn alloc] | 207 scoped_nsobject<NSTableColumn> column([[NSTableColumn alloc] |
| 202 initWithIdentifier:[NSNumber numberWithInt:columnId]]); | 208 initWithIdentifier:[NSNumber numberWithInt:columnId]]); |
| 203 | 209 |
| 204 NSTextAlignment textAlignment = columnId == IDS_TASK_MANAGER_PAGE_COLUMN ? | 210 NSTextAlignment textAlignment = columnId == IDS_TASK_MANAGER_PAGE_COLUMN ? |
| 205 NSLeftTextAlignment : NSRightTextAlignment; | 211 NSLeftTextAlignment : NSRightTextAlignment; |
| 206 | 212 |
| 207 [[column.get() headerCell] | 213 [[column.get() headerCell] |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 void TaskManagerMac::Show() { | 573 void TaskManagerMac::Show() { |
| 568 if (instance_) { | 574 if (instance_) { |
| 569 // If there's a Task manager window open already, just activate it. | 575 // If there's a Task manager window open already, just activate it. |
| 570 [[instance_->window_controller_ window] | 576 [[instance_->window_controller_ window] |
| 571 makeKeyAndOrderFront:instance_->window_controller_]; | 577 makeKeyAndOrderFront:instance_->window_controller_]; |
| 572 } else { | 578 } else { |
| 573 instance_ = new TaskManagerMac(TaskManager::GetInstance()); | 579 instance_ = new TaskManagerMac(TaskManager::GetInstance()); |
| 574 instance_->model_->StartUpdating(); | 580 instance_->model_->StartUpdating(); |
| 575 } | 581 } |
| 576 } | 582 } |
| OLD | NEW |