Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: chrome/browser/ui/cocoa/download/download_item_button.h

Issue 1125423002: Dismiss context menu when download bar is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refine unit test. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/download/download_item_button.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #import "chrome/browser/ui/cocoa/draggable_button.h" 8 #import "chrome/browser/ui/cocoa/draggable_button.h"
9 #import "chrome/browser/ui/cocoa/themed_window.h" 9 #import "chrome/browser/ui/cocoa/themed_window.h"
10 10
11 @class DownloadItemController; 11 @class DownloadItemController;
12 12
13 // A button that is a drag source for a file and that displays a context menu 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. 14 // instead of firing an action when clicked in a certain area.
15 @interface DownloadItemButton 15 @interface DownloadItemButton
16 : DraggableButton<NSMenuDelegate, ThemedWindowDrawing> { 16 : DraggableButton<NSMenuDelegate, ThemedWindowDrawing> {
17 @private 17 @private
18 base::FilePath downloadPath_; 18 base::FilePath downloadPath_;
19 DownloadItemController* controller_; // weak 19 DownloadItemController* controller_; // weak
20 base::scoped_nsobject<NSMenu> contextMenu_;
20 } 21 }
21 22
22 @property(assign, nonatomic) base::FilePath download; 23 @property(assign, nonatomic) base::FilePath download;
23 @property(assign, nonatomic) DownloadItemController* controller; 24 @property(assign, nonatomic) DownloadItemController* controller;
24 25
26 // Shows the DownloadItemButton's context menu.
27 - (void)showContextMenu;
28
25 // Overridden from DraggableButton. 29 // Overridden from DraggableButton.
26 - (void)beginDrag:(NSEvent*)event; 30 - (void)beginDrag:(NSEvent*)event;
27 31
28 @end 32 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/download/download_item_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698