| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_BUTTON_H_ |
| 7 |
| 5 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 6 | 9 |
| 7 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 8 #import "chrome/browser/ui/cocoa/draggable_button.h" | 11 #import "chrome/browser/ui/cocoa/draggable_button.h" |
| 9 #import "chrome/browser/ui/cocoa/themed_window.h" | 12 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 10 | 13 |
| 11 @class DownloadItemController; | 14 @class DownloadItemController; |
| 12 | 15 |
| 13 // A button that is a drag source for a file and that displays a context menu | 16 // A button that is a drag source for a file and that displays a context menu |
| 14 // instead of firing an action when clicked in a certain area. | 17 // instead of firing an action when clicked in a certain area. |
| 15 @interface DownloadItemButton | 18 @interface DownloadItemButton |
| 16 : DraggableButton<NSMenuDelegate, ThemedWindowDrawing> { | 19 : DraggableButton<NSMenuDelegate, ThemedWindowDrawing> { |
| 17 @private | 20 @private |
| 18 base::FilePath downloadPath_; | 21 base::FilePath downloadPath_; |
| 19 DownloadItemController* controller_; // weak | 22 DownloadItemController* controller_; // weak |
| 20 base::scoped_nsobject<NSMenu> contextMenu_; | 23 base::scoped_nsobject<NSMenu> contextMenu_; |
| 21 } | 24 } |
| 22 | 25 |
| 23 @property(assign, nonatomic) base::FilePath download; | 26 @property(assign, nonatomic) base::FilePath download; |
| 24 @property(assign, nonatomic) DownloadItemController* controller; | 27 @property(assign, nonatomic) DownloadItemController* controller; |
| 25 | 28 |
| 26 // Shows the DownloadItemButton's context menu. | 29 // Shows the DownloadItemButton's context menu. |
| 27 - (void)showContextMenu; | 30 - (void)showContextMenu; |
| 28 | 31 |
| 29 // Overridden from DraggableButton. | 32 // Overridden from DraggableButton. |
| 30 - (void)beginDrag:(NSEvent*)event; | 33 - (void)beginDrag:(NSEvent*)event; |
| 31 | 34 |
| 32 @end | 35 @end |
| 36 |
| 37 #endif // CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_BUTTON_H_ |
| OLD | NEW |