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
3 // found in the LICENSE file.
5 #import <Cocoa/Cocoa.h>
7 #include "base/files/file_path.h"
8 #import "chrome/browser/ui/cocoa/draggable_button.h"
9 #import "chrome/browser/ui/cocoa/themed_window.h"
11 @
class DownloadItemController
;
13 // 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.
15 @interface DownloadItemButton
16 : DraggableButton
<NSMenuDelegate
, ThemedWindowDrawing
> {
18 base::FilePath downloadPath_
;
19 DownloadItemController
* controller_
; // weak
20 base::scoped_nsobject
<NSMenu
> contextMenu_
;
23 @
property(assign
, nonatomic
) base::FilePath download
;
24 @
property(assign
, nonatomic
) DownloadItemController
* controller
;
26 // Shows the DownloadItemButton's context menu.
27 - (void)showContextMenu
;
29 // Overridden from DraggableButton.
30 - (void)beginDrag
:(NSEvent
*)event
;