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/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #import "chrome/browser/ui/cocoa/view_resizer.h" | 9 #import "chrome/browser/ui/cocoa/view_resizer.h" |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Delegate that handles resizing our view. | 70 // Delegate that handles resizing our view. |
71 id<ViewResizer> resizeDelegate_; | 71 id<ViewResizer> resizeDelegate_; |
72 | 72 |
73 // Used for loading pages. | 73 // Used for loading pages. |
74 content::PageNavigator* navigator_; | 74 content::PageNavigator* navigator_; |
75 }; | 75 }; |
76 | 76 |
77 - (id)initWithBrowser:(Browser*)browser | 77 - (id)initWithBrowser:(Browser*)browser |
78 resizeDelegate:(id<ViewResizer>)resizeDelegate; | 78 resizeDelegate:(id<ViewResizer>)resizeDelegate; |
79 | 79 |
| 80 // Run when the user clicks the 'Show All' button. |
80 - (IBAction)showDownloadsTab:(id)sender; | 81 - (IBAction)showDownloadsTab:(id)sender; |
81 | 82 |
82 // Returns our view cast as an AnimatableView. | 83 // Run when the user clicks the close button on the right side of the shelf. |
83 - (AnimatableView*)animatableView; | 84 - (IBAction)handleClose:(id)sender; |
84 | 85 |
85 - (DownloadShelf*)bridge; | 86 // Shows or hides the download shelf based on the value of |show|. |
86 - (BOOL)isVisible; | 87 // |isUserAction| should be YES if the operation is being triggered based on a |
| 88 // user action (currently only relevant when hiding the shelf). |
| 89 // Note: This is intended to be invoked from DownloadShelfMac. If invoked |
| 90 // directly, the shelf visibility state maintained by DownloadShelf and the |
| 91 // owning Browser will not be updated. |
| 92 - (void)showDownloadShelf:(BOOL)show |
| 93 isUserAction:(BOOL)isUserAction; |
87 | 94 |
88 - (IBAction)show:(id)sender; | 95 // Re-layouts all download items based on their current state. |
| 96 - (void)layoutItems; |
89 | 97 |
90 // Run when the user clicks the close button on the right side of the shelf. | 98 // Add a new download item to the leftmost position of the download shelf. The |
91 - (IBAction)hide:(id)sender; | 99 // item should not have been already added to this shelf. |
92 | |
93 - (void)addDownloadItem:(content::DownloadItem*)downloadItem; | 100 - (void)addDownloadItem:(content::DownloadItem*)downloadItem; |
94 | 101 |
95 // Remove a download, possibly via clearing browser data. | 102 // Remove a download, possibly via clearing browser data. |
96 - (void)remove:(DownloadItemController*)download; | 103 - (void)remove:(DownloadItemController*)download; |
97 | 104 |
98 // Called by individual item controllers when their downloads are opened. | 105 // Called by individual item controllers when their downloads are opened. |
99 - (void)downloadWasOpened:(DownloadItemController*)download; | 106 - (void)downloadWasOpened:(DownloadItemController*)download; |
100 | 107 |
101 // Notification that we are closing and should release our downloads. | 108 // Notification that we are closing and should release our downloads. |
102 - (void)exiting; | 109 - (void)exiting; |
103 | 110 |
| 111 // Returns our view cast as an AnimatableView. |
| 112 - (AnimatableView*)animatableView; |
| 113 |
| 114 - (DownloadShelf*)bridge; |
| 115 |
| 116 - (BOOL)isVisible; |
| 117 |
104 // Return the height of the download shelf. | 118 // Return the height of the download shelf. |
105 - (float)height; | 119 - (float)height; |
106 | 120 |
107 // Re-layouts all download items based on their current state. | |
108 - (void)layoutItems; | |
109 | |
110 @end | 121 @end |
OLD | NEW |