OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "base/mac/cocoa_protocols.h" | 7 #import "base/mac/cocoa_protocols.h" |
8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #import "chrome/browser/ui/cocoa/view_resizer.h" | 10 #import "chrome/browser/ui/cocoa/view_resizer.h" |
11 | 11 |
12 @class AnimatableView; | 12 @class AnimatableView; |
13 class BaseDownloadItemModel; | 13 class BaseDownloadItemModel; |
14 class Browser; | 14 class Browser; |
15 @class BrowserWindowController; | 15 @class BrowserWindowController; |
16 @class DownloadItemController; | 16 @class DownloadItemController; |
17 class DownloadShelf; | 17 class DownloadShelf; |
18 @class DownloadShelfView; | 18 @class DownloadShelfView; |
19 @class HyperlinkButtonCell; | 19 @class HyperlinkButtonCell; |
20 @class HoverButton; | 20 @class HoverButton; |
21 | 21 |
| 22 namespace content { |
| 23 class PageNavigator; |
| 24 } |
| 25 |
22 // A controller class that manages the download shelf for one window. It is | 26 // A controller class that manages the download shelf for one window. It is |
23 // responsible for the behavior of the shelf itself (showing/hiding, handling | 27 // responsible for the behavior of the shelf itself (showing/hiding, handling |
24 // the link, layout) as well as for managing the download items it contains. | 28 // the link, layout) as well as for managing the download items it contains. |
25 // | 29 // |
26 // All the files in cocoa/downloads_* are related as follows: | 30 // All the files in cocoa/downloads_* are related as follows: |
27 // | 31 // |
28 // download_shelf_mac bridges calls from chromium's c++ world to the objc | 32 // download_shelf_mac bridges calls from chromium's c++ world to the objc |
29 // download_shelf_controller for the shelf (this file). The shelf's background | 33 // download_shelf_controller for the shelf (this file). The shelf's background |
30 // is drawn by download_shelf_view. Every item in a shelf is controlled by a | 34 // is drawn by download_shelf_view. Every item in a shelf is controlled by a |
31 // download_item_controller. | 35 // download_item_controller. |
(...skipping 27 matching lines...) Expand all Loading... |
59 scoped_nsobject<NSTrackingArea> trackingArea_; | 63 scoped_nsobject<NSTrackingArea> trackingArea_; |
60 | 64 |
61 // The download items we have added to our shelf. | 65 // The download items we have added to our shelf. |
62 scoped_nsobject<NSMutableArray> downloadItemControllers_; | 66 scoped_nsobject<NSMutableArray> downloadItemControllers_; |
63 | 67 |
64 // The container that contains (and clamps) all the download items. | 68 // The container that contains (and clamps) all the download items. |
65 IBOutlet NSView* itemContainerView_; | 69 IBOutlet NSView* itemContainerView_; |
66 | 70 |
67 // Delegate that handles resizing our view. | 71 // Delegate that handles resizing our view. |
68 id<ViewResizer> resizeDelegate_; | 72 id<ViewResizer> resizeDelegate_; |
| 73 |
| 74 // Used for loading pages. |
| 75 content::PageNavigator* navigator_; |
69 }; | 76 }; |
70 | 77 |
71 - (id)initWithBrowser:(Browser*)browser | 78 - (id)initWithBrowser:(Browser*)browser |
72 resizeDelegate:(id<ViewResizer>)resizeDelegate; | 79 resizeDelegate:(id<ViewResizer>)resizeDelegate; |
73 | 80 |
74 - (IBAction)showDownloadsTab:(id)sender; | 81 - (IBAction)showDownloadsTab:(id)sender; |
75 | 82 |
76 // Returns our view cast as an AnimatableView. | 83 // Returns our view cast as an AnimatableView. |
77 - (AnimatableView*)animatableView; | 84 - (AnimatableView*)animatableView; |
78 | 85 |
(...skipping 16 matching lines...) Expand all Loading... |
95 // Notification that we are closing and should release our downloads. | 102 // Notification that we are closing and should release our downloads. |
96 - (void)exiting; | 103 - (void)exiting; |
97 | 104 |
98 // Return the height of the download shelf. | 105 // Return the height of the download shelf. |
99 - (float)height; | 106 - (float)height; |
100 | 107 |
101 // Re-layouts all download items based on their current state. | 108 // Re-layouts all download items based on their current state. |
102 - (void)layoutItems; | 109 - (void)layoutItems; |
103 | 110 |
104 @end | 111 @end |
OLD | NEW |