| 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 |
| 83 // Run when the user clicks the close button on the right side of the shelf. |
| 84 - (IBAction)handleClose:(id)sender; |
| 85 |
| 86 // Shows or hides the download shelf based on the value of |show|. |
| 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; |
| 94 |
| 82 // Returns our view cast as an AnimatableView. | 95 // Returns our view cast as an AnimatableView. |
| 83 - (AnimatableView*)animatableView; | 96 - (AnimatableView*)animatableView; |
| 84 | 97 |
| 85 - (DownloadShelf*)bridge; | 98 - (DownloadShelf*)bridge; |
| 86 - (BOOL)isVisible; | 99 - (BOOL)isVisible; |
| 87 | 100 |
| 88 - (IBAction)show:(id)sender; | 101 // Add a new download item to the leftmost position of the download shelf. The |
| 89 | 102 // item should not have been already added to this shelf. |
| 90 // Run when the user clicks the close button on the right side of the shelf. | |
| 91 - (IBAction)hide:(id)sender; | |
| 92 | |
| 93 - (void)addDownloadItem:(content::DownloadItem*)downloadItem; | 103 - (void)addDownloadItem:(content::DownloadItem*)downloadItem; |
| 94 | 104 |
| 95 // Remove a download, possibly via clearing browser data. | 105 // Remove a download, possibly via clearing browser data. |
| 96 - (void)remove:(DownloadItemController*)download; | 106 - (void)remove:(DownloadItemController*)download; |
| 97 | 107 |
| 98 // Called by individual item controllers when their downloads are opened. | 108 // Called by individual item controllers when their downloads are opened. |
| 99 - (void)downloadWasOpened:(DownloadItemController*)download; | 109 - (void)downloadWasOpened:(DownloadItemController*)download; |
| 100 | 110 |
| 101 // Notification that we are closing and should release our downloads. | 111 // Notification that we are closing and should release our downloads. |
| 102 - (void)exiting; | 112 - (void)exiting; |
| 103 | 113 |
| 104 // Return the height of the download shelf. | 114 // Return the height of the download shelf. |
| 105 - (float)height; | 115 - (float)height; |
| 106 | 116 |
| 107 // Re-layouts all download items based on their current state. | 117 // Re-layouts all download items based on their current state. |
| 108 - (void)layoutItems; | 118 - (void)layoutItems; |
| 109 | 119 |
| 110 @end | 120 @end |
| OLD | NEW |