| 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 | 596 |
| 597 //////////////////////////////////////////////////////////////////////////////// | 597 //////////////////////////////////////////////////////////////////////////////// |
| 598 // Called by the TaskManagerWindowController: | 598 // Called by the TaskManagerWindowController: |
| 599 | 599 |
| 600 void TaskManagerMac::WindowWasClosed() { | 600 void TaskManagerMac::WindowWasClosed() { |
| 601 delete this; | 601 delete this; |
| 602 instance_ = nullptr; // |instance_| is static | 602 instance_ = nullptr; // |instance_| is static |
| 603 } | 603 } |
| 604 | 604 |
| 605 NSImage* TaskManagerMac::GetImageForRow(int row) { | 605 NSImage* TaskManagerMac::GetImageForRow(int row) { |
| 606 const CGFloat kImageWidth = 16.0; | 606 const NSSize kImageSize = NSMakeSize(16.0, 16.0); |
| 607 NSImage* image = gfx::NSImageFromImageSkia(table_model_->GetIcon(row)); | 607 NSImage* image = gfx::NSImageFromImageSkia(table_model_->GetIcon(row)); |
| 608 if (!image) { | 608 if (image) |
| 609 image = [[[NSImage alloc] initWithSize:NSMakeSize(kImageWidth, kImageWidth)] | 609 image.size = kImageSize; |
| 610 autorelease]; | 610 else |
| 611 } | 611 image = [[[NSImage alloc] initWithSize:kImageSize] autorelease]; |
| 612 |
| 612 return image; | 613 return image; |
| 613 } | 614 } |
| 614 | 615 |
| 615 void TaskManagerMac::Observe(int type, | 616 void TaskManagerMac::Observe(int type, |
| 616 const content::NotificationSource& source, | 617 const content::NotificationSource& source, |
| 617 const content::NotificationDetails& details) { | 618 const content::NotificationDetails& details) { |
| 618 DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); | 619 DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); |
| 619 Hide(); | 620 Hide(); |
| 620 } | 621 } |
| 621 | 622 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 652 void HideTaskManager() { | 653 void HideTaskManager() { |
| 653 if (chrome::ToolkitViewsDialogsEnabled()) { | 654 if (chrome::ToolkitViewsDialogsEnabled()) { |
| 654 chrome::HideTaskManagerViews(); | 655 chrome::HideTaskManagerViews(); |
| 655 return; | 656 return; |
| 656 } | 657 } |
| 657 | 658 |
| 658 task_management::TaskManagerMac::Hide(); | 659 task_management::TaskManagerMac::Hide(); |
| 659 } | 660 } |
| 660 | 661 |
| 661 } // namespace chrome | 662 } // namespace chrome |
| OLD | NEW |