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

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

Issue 2208013002: Force all Mac Task Manager icons to be the same size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698