diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 20:15:29 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 20:15:29 +0000 |
commit | aff79ca1394874db779d4fd6b2fc0d6be8dded30 (patch) | |
tree | 23fa285039694edb0299d57eaa3fcc8e9a469f08 /chrome/browser/cocoa/download_item_mac.mm | |
parent | 34fdaa66a62afa9b4b33a4b9d48d688eeb25b11e (diff) | |
download | chromium_src-aff79ca1394874db779d4fd6b2fc0d6be8dded30.zip chromium_src-aff79ca1394874db779d4fd6b2fc0d6be8dded30.tar.gz chromium_src-aff79ca1394874db779d4fd6b2fc0d6be8dded30.tar.bz2 |
Fix download item icon.
BUG=none
TEST=Download something, note that the correct item shows up in the shelf.
Review URL: http://codereview.chromium.org/150015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/download_item_mac.mm')
-rw-r--r-- | chrome/browser/cocoa/download_item_mac.mm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/download_item_mac.mm b/chrome/browser/cocoa/download_item_mac.mm index eca5316..e9d86d2 100644 --- a/chrome/browser/cocoa/download_item_mac.mm +++ b/chrome/browser/cocoa/download_item_mac.mm @@ -128,11 +128,11 @@ DownloadItemMac::DownloadItemMac(BaseDownloadItemModel* download_model, [[NSPopUpButton alloc] initWithFrame:frame pullsDown:YES]); [parent_ addDownloadItem:view.get()]; - // TODO(thakis): use filename eliding like gtk/windows versions - std::wstring tmpname = - download_model->download()->GetFileName().ToWStringHack(); + FilePath download_path = download_model->download()->GetFileName(); - NSString* titleString = base::SysWideToNSString(tmpname); + // TODO(thakis): use filename eliding like gtk/windows versions + NSString* titleString = base::SysWideToNSString( + download_path.ToWStringHack()); menu_.reset([[DownloadShelfContextMenuBridge alloc] initWithModel:download_model_.get()]); @@ -140,10 +140,9 @@ DownloadItemMac::DownloadItemMac(BaseDownloadItemModel* download_model, [view.get() insertItemWithTitle:titleString atIndex:0]; - // TODO(thakis): Use file extension and iconForFileType. Currently, this - // complains "<filename> is not a full path." + NSString* extension = base::SysUTF8ToNSString(download_path.Extension()); [[view.get() itemAtIndex:0] setImage: - [[NSWorkspace sharedWorkspace] iconForFile:titleString]]; + [[NSWorkspace sharedWorkspace] iconForFileType:extension]]; } DownloadItemMac::~DownloadItemMac() { |