| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #import "chrome/browser/cocoa/download_item_controller.h" | 5 #import "chrome/browser/cocoa/download_item_controller.h" |
| 6 | 6 |
| 7 #include "app/gfx/text_elider.h" | 7 #include "app/gfx/text_elider.h" |
| 8 #include "app/l10n_util_mac.h" | 8 #include "app/l10n_util_mac.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 shelf_ = shelf; | 55 shelf_ = shelf; |
| 56 state_ = kNormal; | 56 state_ = kNormal; |
| 57 creationTime_ = base::Time::Now(); | 57 creationTime_ = base::Time::Now(); |
| 58 } | 58 } |
| 59 return self; | 59 return self; |
| 60 } | 60 } |
| 61 | 61 |
| 62 - (void)dealloc { | 62 - (void)dealloc { |
| 63 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 63 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 64 [[self view] removeFromSuperview]; |
| 64 [super dealloc]; | 65 [super dealloc]; |
| 65 } | 66 } |
| 66 | 67 |
| 67 - (void)awakeFromNib { | 68 - (void)awakeFromNib { |
| 68 [self setStateFromDownload:bridge_->download_model()]; | 69 [self setStateFromDownload:bridge_->download_model()]; |
| 69 bridge_->LoadIcon(); | 70 bridge_->LoadIcon(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 - (void)setStateFromDownload:(BaseDownloadItemModel*)downloadModel { | 73 - (void)setStateFromDownload:(BaseDownloadItemModel*)downloadModel { |
| 73 DCHECK_EQ(bridge_->download_model(), downloadModel); | 74 DCHECK_EQ(bridge_->download_model(), downloadModel); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 232 |
| 232 - (IBAction)handleRemove:(id)sender { | 233 - (IBAction)handleRemove:(id)sender { |
| 233 menuBridge_->ExecuteItemCommand(DownloadShelfContextMenuMac::REMOVE_ITEM); | 234 menuBridge_->ExecuteItemCommand(DownloadShelfContextMenuMac::REMOVE_ITEM); |
| 234 } | 235 } |
| 235 | 236 |
| 236 - (IBAction)handleCancel:(id)sender { | 237 - (IBAction)handleCancel:(id)sender { |
| 237 menuBridge_->ExecuteItemCommand(DownloadShelfContextMenuMac::CANCEL); | 238 menuBridge_->ExecuteItemCommand(DownloadShelfContextMenuMac::CANCEL); |
| 238 } | 239 } |
| 239 | 240 |
| 240 @end | 241 @end |
| OLD | NEW |