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

Unified Diff: chrome/browser/ui/cocoa/download/download_item_controller.mm

Issue 11673004: No need to pass DownloadItemModel ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DownloadShelfContextMenu class cleanup and require GetMenuModel() to return non-NULL Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/download/download_item_controller.mm
diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm
index e89a86effd17aec38350ed6b6f1182b1285c69aa..574756ed433737c11e84782105a5f59ddd10386b 100644
--- a/chrome/browser/ui/cocoa/download/download_item_controller.mm
+++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm
@@ -74,9 +74,9 @@ void WidenView(NSView* view, CGFloat widthChange) {
class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
public:
- DownloadShelfContextMenuMac(DownloadItemModel* model,
+ DownloadShelfContextMenuMac(DownloadItem* downloadItem,
content::PageNavigator* navigator)
- : DownloadShelfContextMenu(model, navigator) { }
+ : DownloadShelfContextMenu(downloadItem, navigator) { }
using DownloadShelfContextMenu::ExecuteCommand;
using DownloadShelfContextMenu::IsCommandIdChecked;
@@ -99,14 +99,14 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
@implementation DownloadItemController
-- (id)initWithModel:(DownloadItemModel*)downloadModel
- shelf:(DownloadShelfController*)shelf
- navigator:(content::PageNavigator*)navigator {
+- (id)initWithDownload:(DownloadItem*)downloadItem
+ shelf:(DownloadShelfController*)shelf
+ navigator:(content::PageNavigator*)navigator {
if ((self = [super initWithNibName:@"DownloadItem"
bundle:base::mac::FrameworkBundle()])) {
// Must be called before [self view], so that bridge_ is set in awakeFromNib
- bridge_.reset(new DownloadItemMac(downloadModel, self));
- menuBridge_.reset(new DownloadShelfContextMenuMac(downloadModel,
+ bridge_.reset(new DownloadItemMac(downloadItem, self));
+ menuBridge_.reset(new DownloadShelfContextMenuMac(downloadItem,
navigator));
NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
@@ -164,7 +164,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
}
- (void)setStateFromDownload:(DownloadItemModel*)downloadModel {
- DCHECK_EQ(bridge_->download_model(), downloadModel);
+ DCHECK_EQ([self download], downloadModel->download());
// Handle dangerous downloads.
if (downloadModel->IsDangerous()) {
« no previous file with comments | « chrome/browser/ui/cocoa/download/download_item_controller.h ('k') | chrome/browser/ui/cocoa/download/download_item_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698