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 #include <vector> | |
6 | 7 |
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 |
21 // different things. contentAreaHasOffset_ is an implementation | 24 // different things. contentAreaHasOffset_ is an implementation |
22 // detail of download shelf visibility. | 25 // detail of download 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 std::vector<DownloadItemController*> download_item_controllers_; | |
pink (ping after 24hrs)
2009/07/06 21:45:20
use obj-C naming. Also, make this a NSMutableArray
| |
29 }; | 35 }; |
30 | 36 |
31 - (id)initWithBrowser:(Browser*)browser | 37 - (id)initWithBrowser:(Browser*)browser |
32 contentArea:(NSView*)content; | 38 contentArea:(NSView*)content; |
33 | 39 |
34 - (DownloadShelf*)bridge; | 40 - (DownloadShelf*)bridge; |
35 - (BOOL)isVisible; | 41 - (BOOL)isVisible; |
36 | 42 |
37 - (IBAction)show:(id)sender; | 43 - (IBAction)show:(id)sender; |
38 - (IBAction)hide:(id)sender; | 44 - (IBAction)hide:(id)sender; |
39 | 45 |
40 // TODO(thakis): this should internally build an item and get only | 46 - (void)addDownloadItem:(BaseDownloadItemModel*)view; |
pink (ping after 24hrs)
2009/07/06 21:45:20
is this a model or a view? The param name should p
| |
41 // the model as parameter. | |
42 - (void)addDownloadItem:(NSView*)view; | |
43 | 47 |
44 // Resizes the download shelf based on the state of the content area. | 48 // Resizes the download shelf based on the state of the content area. |
45 - (void)resizeDownloadShelf; | 49 - (void)resizeDownloadShelf; |
46 | 50 |
47 @end | 51 @end |
OLD | NEW |