diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 22:50:13 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 22:50:13 +0000 |
commit | e9ef0a64254e178c3da21e0e27222b11af447dee (patch) | |
tree | 98598d7e72e5c2014f3af75bccb9b1faa1b946ac /chrome/browser/cocoa/download_item_mac.mm | |
parent | f9b1e69dc13119e673795c7ab5b7a302dcd68ee1 (diff) | |
download | chromium_src-e9ef0a64254e178c3da21e0e27222b11af447dee.zip chromium_src-e9ef0a64254e178c3da21e0e27222b11af447dee.tar.gz chromium_src-e9ef0a64254e178c3da21e0e27222b11af447dee.tar.bz2 |
Add "dangerous download" view on OS X, for now for dmg files. Also fix download item layout.
BUG=14667,17831
TEST=Download a dmg file. Make sure the "dangerous download" view appears. Check that both buttons work, and that the dmg filename is elided correctly. Also test that "Remove" on a normal download item's context menu relayouts the remaining items on the shelf.
Review URL: http://codereview.chromium.org/165295
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23103 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 | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/download_item_mac.mm b/chrome/browser/cocoa/download_item_mac.mm index 357c902..453e52c 100644 --- a/chrome/browser/cocoa/download_item_mac.mm +++ b/chrome/browser/cocoa/download_item_mac.mm @@ -25,6 +25,20 @@ DownloadItemMac::~DownloadItemMac() { void DownloadItemMac::OnDownloadUpdated(DownloadItem* download) { DCHECK_EQ(download, download_model_->download()); + if ([item_controller_ isDangerousMode] && + download->safety_state() == DownloadItem::DANGEROUS_BUT_VALIDATED) { + // We have been approved. + [item_controller_ clearDangerousMode]; + } + + if (download->full_path() != lastFilePath_) { + // Turns out the file path is "unconfirmed %d.download" for dangerous + // downloads. When the download is confirmed, the file is renamed on + // another thread, so reload the icon if the download filename changes. + LoadIcon(); + lastFilePath_ = download->full_path(); + } + switch (download_model_->download()->state()) { case DownloadItem::REMOVING: [item_controller_ remove]; // We're deleted now! @@ -35,7 +49,7 @@ void DownloadItemMac::OnDownloadUpdated(DownloadItem* download) { [item_controller_ setStateFromDownload:download_model_.get()]; break; default: - NOTREACHED(); + NOTREACHED(); } } |