OLD | NEW |
1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 | 9 |
10 class BaseDownloadItemModel; | 10 class BaseDownloadItemModel; |
11 @class ChromeUILocalizer; | 11 @class ChromeUILocalizer; |
12 @class DownloadItemCell; | 12 @class DownloadItemCell; |
13 @class DownloadItemButton; | 13 @class DownloadItemButton; |
14 class DownloadItemMac; | 14 class DownloadItemMac; |
15 class DownloadShelfContextMenuMac; | 15 class DownloadShelfContextMenuMac; |
16 @class DownloadShelfController; | 16 @class DownloadShelfController; |
17 @class GTMWidthBasedTweaker; | 17 @class GTMWidthBasedTweaker; |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class DownloadItem; | 20 class DownloadItem; |
21 } | 21 } |
22 | 22 |
| 23 namespace gfx { |
| 24 class Font; |
| 25 } |
| 26 |
23 // A controller class that manages one download item. | 27 // A controller class that manages one download item. |
24 | 28 |
25 @interface DownloadItemController : NSViewController { | 29 @interface DownloadItemController : NSViewController { |
26 @private | 30 @private |
27 IBOutlet DownloadItemButton* progressView_; | 31 IBOutlet DownloadItemButton* progressView_; |
28 IBOutlet DownloadItemCell* cell_; | 32 IBOutlet DownloadItemCell* cell_; |
29 | 33 |
30 IBOutlet NSMenu* activeDownloadMenu_; | 34 IBOutlet NSMenu* activeDownloadMenu_; |
31 IBOutlet NSMenu* completeDownloadMenu_; | 35 IBOutlet NSMenu* completeDownloadMenu_; |
32 | 36 |
(...skipping 16 matching lines...) Expand all Loading... |
49 | 53 |
50 scoped_ptr<DownloadItemMac> bridge_; | 54 scoped_ptr<DownloadItemMac> bridge_; |
51 scoped_ptr<DownloadShelfContextMenuMac> menuBridge_; | 55 scoped_ptr<DownloadShelfContextMenuMac> menuBridge_; |
52 | 56 |
53 // Weak pointer to the shelf that owns us. | 57 // Weak pointer to the shelf that owns us. |
54 DownloadShelfController* shelf_; | 58 DownloadShelfController* shelf_; |
55 | 59 |
56 // The time at which this view was created. | 60 // The time at which this view was created. |
57 base::Time creationTime_; | 61 base::Time creationTime_; |
58 | 62 |
| 63 // Default font to use for text metrics. |
| 64 scoped_ptr<gfx::Font> font_; |
| 65 |
59 // The state of this item. | 66 // The state of this item. |
60 enum DownoadItemState { | 67 enum DownoadItemState { |
61 kNormal, | 68 kNormal, |
62 kDangerous | 69 kDangerous |
63 } state_; | 70 } state_; |
64 }; | 71 }; |
65 | 72 |
66 // Takes ownership of |downloadModel|. | 73 // Takes ownership of |downloadModel|. |
67 - (id)initWithModel:(BaseDownloadItemModel*)downloadModel | 74 - (id)initWithModel:(BaseDownloadItemModel*)downloadModel |
68 shelf:(DownloadShelfController*)shelf; | 75 shelf:(DownloadShelfController*)shelf; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 - (IBAction)discardDownload:(id)sender; | 109 - (IBAction)discardDownload:(id)sender; |
103 | 110 |
104 // Context menu handlers. | 111 // Context menu handlers. |
105 - (IBAction)handleOpen:(id)sender; | 112 - (IBAction)handleOpen:(id)sender; |
106 - (IBAction)handleAlwaysOpen:(id)sender; | 113 - (IBAction)handleAlwaysOpen:(id)sender; |
107 - (IBAction)handleReveal:(id)sender; | 114 - (IBAction)handleReveal:(id)sender; |
108 - (IBAction)handleCancel:(id)sender; | 115 - (IBAction)handleCancel:(id)sender; |
109 - (IBAction)handleTogglePause:(id)sender; | 116 - (IBAction)handleTogglePause:(id)sender; |
110 | 117 |
111 @end | 118 @end |
OLD | NEW |