| 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 | 9 |
| 10 class BaseDownloadItemModel; | 10 class BaseDownloadItemModel; |
| 11 @class DownloadItemCell; | 11 @class DownloadItemCell; |
| 12 class DownloadItem; | 12 class DownloadItem; |
| 13 class DownloadItemMac; | 13 class DownloadItemMac; |
| 14 class DownloadShelfContextMenuMac; | 14 class DownloadShelfContextMenuMac; |
| 15 @class DownloadShelfController; | 15 @class DownloadShelfController; |
| 16 @class GTMWidthBasedTweaker; |
| 16 | 17 |
| 17 // A controller class that manages one download item. | 18 // A controller class that manages one download item. |
| 18 | 19 |
| 19 @interface DownloadItemController : NSViewController { | 20 @interface DownloadItemController : NSViewController { |
| 20 @private | 21 @private |
| 21 IBOutlet NSButton* progressView_; | 22 IBOutlet NSButton* progressView_; |
| 22 IBOutlet DownloadItemCell* cell_; | 23 IBOutlet DownloadItemCell* cell_; |
| 23 | 24 |
| 24 IBOutlet NSMenu* activeDownloadMenu_; | 25 IBOutlet NSMenu* activeDownloadMenu_; |
| 25 IBOutlet NSMenu* completeDownloadMenu_; | 26 IBOutlet NSMenu* completeDownloadMenu_; |
| 26 | 27 |
| 27 NSMenu* currentMenu_; // points to one of the two menus above | 28 NSMenu* currentMenu_; // points to one of the two menus above |
| 28 | 29 |
| 29 // This is shown instead of progressView_ for dangerous downloads. | 30 // This is shown instead of progressView_ for dangerous downloads. |
| 30 IBOutlet NSView* dangerousDownloadView_; | 31 IBOutlet NSView* dangerousDownloadView_; |
| 31 IBOutlet NSTextField* dangerousDownloadLabel_; | 32 IBOutlet NSTextField* dangerousDownloadLabel_; |
| 32 | 33 |
| 34 // So we can find out how much the tweaker changed sizes to update the |
| 35 // other views. |
| 36 IBOutlet GTMWidthBasedTweaker* buttonTweaker_; |
| 37 |
| 33 scoped_ptr<DownloadItemMac> bridge_; | 38 scoped_ptr<DownloadItemMac> bridge_; |
| 34 scoped_ptr<DownloadShelfContextMenuMac> menuBridge_; | 39 scoped_ptr<DownloadShelfContextMenuMac> menuBridge_; |
| 35 | 40 |
| 36 // Weak pointer to the shelf that owns us. | 41 // Weak pointer to the shelf that owns us. |
| 37 DownloadShelfController* shelf_; | 42 DownloadShelfController* shelf_; |
| 38 | 43 |
| 39 // The time at which this view was created. | 44 // The time at which this view was created. |
| 40 base::Time creationTime_; | 45 base::Time creationTime_; |
| 41 | 46 |
| 42 // The state of this item. | 47 // The state of this item. |
| 43 enum DownoadItemState { | 48 enum DownoadItemState { |
| 44 kNormal, | 49 kNormal, |
| 45 kDangerous | 50 kDangerous |
| 46 } state_; | 51 } state_; |
| 47 }; | 52 }; |
| 48 | 53 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 85 |
| 81 // Context menu handlers. | 86 // Context menu handlers. |
| 82 - (IBAction)handleOpen:(id)sender; | 87 - (IBAction)handleOpen:(id)sender; |
| 83 - (IBAction)handleAlwaysOpen:(id)sender; | 88 - (IBAction)handleAlwaysOpen:(id)sender; |
| 84 - (IBAction)handleReveal:(id)sender; | 89 - (IBAction)handleReveal:(id)sender; |
| 85 - (IBAction)handleRemove:(id)sender; | 90 - (IBAction)handleRemove:(id)sender; |
| 86 - (IBAction)handleCancel:(id)sender; | 91 - (IBAction)handleCancel:(id)sender; |
| 87 | 92 |
| 88 @end | 93 @end |
| 89 | 94 |
| OLD | NEW |