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_nsobject.h" |
7 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
8 | 9 |
| 10 class BaseDownloadItemModel; |
9 class Browser; | 11 class Browser; |
10 @class BrowserWindowController; | 12 @class BrowserWindowController; |
| 13 @class DownloadItemController; |
11 class DownloadShelf; | 14 class DownloadShelf; |
12 @class DownloadShelfView; | 15 @class DownloadShelfView; |
13 | 16 |
14 // A controller class that manages the download shelf for one window. | 17 // A controller class that manages the download shelf for one window. |
15 | 18 |
16 @interface DownloadShelfController : NSViewController { | 19 @interface DownloadShelfController : NSViewController { |
17 @private | 20 @private |
18 IBOutlet NSTextView* showAllDownloadsLink_; | 21 IBOutlet NSTextView* showAllDownloadsLink_; |
19 | 22 |
20 // Currently these two are always the same, but they mean slightly | 23 // Currently these two are always the same, but they mean slightly different |
21 // different things. contentAreaHasOffset_ is an implementation | 24 // things. |contentAreaHasOffset_| is an implementation detail of the download |
22 // detail of download shelf visibility. | 25 // shelf visibility. |
23 BOOL contentAreaHasOffset_; | 26 BOOL contentAreaHasOffset_; |
24 BOOL barIsVisible_; | 27 BOOL barIsVisible_; |
25 | 28 |
26 scoped_ptr<DownloadShelf> bridge_; | 29 scoped_ptr<DownloadShelf> bridge_; |
27 NSView* contentArea_; | 30 NSView* contentArea_; |
28 int shelfHeight_; | 31 int shelfHeight_; |
| 32 |
| 33 // The download items we have added to our shelf. |
| 34 scoped_nsobject<NSMutableArray> downloadItemControllers_; |
29 }; | 35 }; |
30 | 36 |
31 - (id)initWithBrowser:(Browser*)browser | 37 - (id)initWithBrowser:(Browser*)browser contentArea:(NSView*)content; |
32 contentArea:(NSView*)content; | |
33 | 38 |
34 - (DownloadShelf*)bridge; | 39 - (DownloadShelf*)bridge; |
35 - (BOOL)isVisible; | 40 - (BOOL)isVisible; |
36 | 41 |
37 - (IBAction)show:(id)sender; | 42 - (IBAction)show:(id)sender; |
38 - (IBAction)hide:(id)sender; | 43 - (IBAction)hide:(id)sender; |
39 | 44 |
40 // TODO(thakis): this should internally build an item and get only | 45 - (void)addDownloadItem:(BaseDownloadItemModel*)model; |
41 // the model as parameter. | |
42 - (void)addDownloadItem:(NSView*)view; | |
43 | 46 |
44 // Resizes the download shelf based on the state of the content area. | 47 // Resizes the download shelf based on the state of the content area. |
45 - (void)resizeDownloadShelf; | 48 - (void)resizeDownloadShelf; |
46 | 49 |
47 @end | 50 @end |
OLD | NEW |