OLD | NEW |
1 // Copyright (c) 2012 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/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h" |
9 #import "chrome/browser/ui/cocoa/view_resizer.h" | 10 #import "chrome/browser/ui/cocoa/view_resizer.h" |
10 #include "ui/base/cocoa/tracking_area.h" | 11 #include "ui/base/cocoa/tracking_area.h" |
11 | 12 |
12 @class AnimatableView; | 13 @class AnimatableView; |
13 class Browser; | 14 class Browser; |
14 @class BrowserWindowController; | 15 @class BrowserWindowController; |
15 @class DownloadItemController; | 16 @class DownloadItemController; |
16 class DownloadShelf; | 17 class DownloadShelf; |
17 @class DownloadShelfView; | 18 @class DownloadShelfView; |
18 @class HyperlinkButtonCell; | 19 @class HyperlinkButtonCell; |
(...skipping 14 matching lines...) Expand all Loading... |
33 // download_shelf_controller for the shelf (this file). The shelf's background | 34 // download_shelf_controller for the shelf (this file). The shelf's background |
34 // is drawn by download_shelf_view. Every item in a shelf is controlled by a | 35 // is drawn by download_shelf_view. Every item in a shelf is controlled by a |
35 // download_item_controller. | 36 // download_item_controller. |
36 // | 37 // |
37 // download_item_mac bridges calls from chromium's c++ world to the objc | 38 // download_item_mac bridges calls from chromium's c++ world to the objc |
38 // download_item_controller, which is responsible for managing a single item | 39 // download_item_controller, which is responsible for managing a single item |
39 // on the shelf. The item controller loads its UI from a xib file, where the | 40 // on the shelf. The item controller loads its UI from a xib file, where the |
40 // UI of an item itself is represented by a button that is drawn by | 41 // UI of an item itself is represented by a button that is drawn by |
41 // download_item_cell. | 42 // download_item_cell. |
42 | 43 |
43 @interface DownloadShelfController : NSViewController<NSTextViewDelegate> { | 44 @interface DownloadShelfController |
| 45 : NSViewController<NSTextViewDelegate, HasWeakBrowserPointer> { |
44 @private | 46 @private |
45 IBOutlet HoverButton* hoverCloseButton_; | 47 IBOutlet HoverButton* hoverCloseButton_; |
46 | 48 |
47 // YES if the download shelf is intended to be displayed. The shelf animates | 49 // YES if the download shelf is intended to be displayed. The shelf animates |
48 // out when it is closing. During this time, barIsVisible_ is NO although the | 50 // out when it is closing. During this time, barIsVisible_ is NO although the |
49 // shelf is still visible on screen. | 51 // shelf is still visible on screen. |
50 BOOL barIsVisible_; | 52 BOOL barIsVisible_; |
51 | 53 |
52 // YES if the containing browser window is fullscreen. | 54 // YES if the containing browser window is fullscreen. |
53 BOOL isFullscreen_; | 55 BOOL isFullscreen_; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 115 |
114 // Similar to addDownloadItem above, but adds a DownloadItemController. | 116 // Similar to addDownloadItem above, but adds a DownloadItemController. |
115 - (void)add:(DownloadItemController*)download; | 117 - (void)add:(DownloadItemController*)download; |
116 | 118 |
117 // Remove a download, possibly via clearing browser data. | 119 // Remove a download, possibly via clearing browser data. |
118 - (void)remove:(DownloadItemController*)download; | 120 - (void)remove:(DownloadItemController*)download; |
119 | 121 |
120 // Called by individual item controllers when their downloads are opened. | 122 // Called by individual item controllers when their downloads are opened. |
121 - (void)downloadWasOpened:(DownloadItemController*)download; | 123 - (void)downloadWasOpened:(DownloadItemController*)download; |
122 | 124 |
123 // Notification that the download shelf is going to be destroyed and should | |
124 // release the downloads. | |
125 - (void)exiting; | |
126 | |
127 // Return the height of the download shelf. | 125 // Return the height of the download shelf. |
128 - (float)height; | 126 - (float)height; |
129 | 127 |
130 // Re-layouts all download items based on their current state. | 128 // Re-layouts all download items based on their current state. |
131 - (void)layoutItems; | 129 - (void)layoutItems; |
132 | 130 |
133 @end | 131 @end |
OLD | NEW |