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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_item_mac.mm

Issue 9968090: Added download error descriptions to tooltips for Mac & Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed tooltip to using the short error status string. Created 8 years, 8 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 | Annotate | Revision Log
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/download/download_item_mac.h" 5 #include "chrome/browser/ui/cocoa/download/download_item_mac.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/download/download_item_model.h" 9 #include "chrome/browser/download/download_item_model.h"
10 #import "chrome/browser/ui/cocoa/download/download_item_controller.h" 10 #import "chrome/browser/ui/cocoa/download/download_item_controller.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 [item_controller_ remove]; // We're deleted now! 50 [item_controller_ remove]; // We're deleted now!
51 break; 51 break;
52 case DownloadItem::COMPLETE: 52 case DownloadItem::COMPLETE:
53 if (download->GetAutoOpened()) { 53 if (download->GetAutoOpened()) {
54 [item_controller_ remove]; // We're deleted now! 54 [item_controller_ remove]; // We're deleted now!
55 return; 55 return;
56 } 56 }
57 download_util::NotifySystemOfDownloadComplete(download->GetFullPath()); 57 download_util::NotifySystemOfDownloadComplete(download->GetFullPath());
58 // fall through 58 // fall through
59 case DownloadItem::IN_PROGRESS: 59 case DownloadItem::IN_PROGRESS:
60 case DownloadItem::CANCELLED:
61 [item_controller_ setStateFromDownload:download_model_.get()];
62 break;
60 case DownloadItem::INTERRUPTED: 63 case DownloadItem::INTERRUPTED:
61 case DownloadItem::CANCELLED: 64 [item_controller_ updateToolTip];
62 [item_controller_ setStateFromDownload:download_model_.get()]; 65 [item_controller_ setStateFromDownload:download_model_.get()];
63 break; 66 break;
64 default: 67 default:
65 NOTREACHED(); 68 NOTREACHED();
66 } 69 }
67 } 70 }
68 71
69 void DownloadItemMac::OnDownloadOpened(content::DownloadItem* download) { 72 void DownloadItemMac::OnDownloadOpened(content::DownloadItem* download) {
70 DCHECK_EQ(download, download_model_->download()); 73 DCHECK_EQ(download, download_model_->download());
71 [item_controller_ downloadWasOpened]; 74 [item_controller_ downloadWasOpened];
(...skipping 19 matching lines...) Expand all
91 base::Bind(&DownloadItemMac::OnExtractIconComplete, 94 base::Bind(&DownloadItemMac::OnExtractIconComplete,
92 base::Unretained(this))); 95 base::Unretained(this)));
93 } 96 }
94 97
95 void DownloadItemMac::OnExtractIconComplete(IconManager::Handle handle, 98 void DownloadItemMac::OnExtractIconComplete(IconManager::Handle handle,
96 gfx::Image* icon) { 99 gfx::Image* icon) {
97 if (!icon) 100 if (!icon)
98 return; 101 return;
99 [item_controller_ setIcon:*icon]; 102 [item_controller_ setIcon:*icon];
100 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698