From aa033af5a4a6415200781d0704a36fe724ecd803 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Tue, 27 Jul 2010 18:16:39 +0000 Subject: Download code cleanup: - make the code more object-oriented, make the object expose less accessors - make some parts of code look more obvious, use existing helpers - make the public interfaces slightly better (less ctor parameters) - make some names slightly better TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3029025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53808 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/download_item_controller.mm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'chrome/browser/cocoa/download_item_controller.mm') diff --git a/chrome/browser/cocoa/download_item_controller.mm b/chrome/browser/cocoa/download_item_controller.mm index 00e2110..1c77eee 100644 --- a/chrome/browser/cocoa/download_item_controller.mm +++ b/chrome/browser/cocoa/download_item_controller.mm @@ -244,10 +244,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { - (IBAction)handleButtonClick:(id)sender { DownloadItem* download = bridge_->download_model()->download(); - if (download->state() == DownloadItem::IN_PROGRESS) - download->set_open_when_complete(!download->open_when_complete()); - else if (download->state() == DownloadItem::COMPLETE) - download_util::OpenDownload(download); + download->OpenDownload(); } - (NSSize)preferredSize { @@ -318,8 +315,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download", base::Time::Now() - creationTime_); // This will change the state and notify us. - bridge_->download_model()->download()->manager()->DangerousDownloadValidated( - bridge_->download_model()->download()); + bridge_->download_model()->download()->DangerousDownloadValidated(); } - (IBAction)discardDownload:(id)sender { -- cgit v1.1