| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COCOA_DOWNLOAD_ITEM_CELL_H_ | 5 #ifndef CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_CELL_H_ |
| 6 #define CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_CELL_H_ | 6 #define CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_CELL_H_ |
| 7 | 7 |
| 8 #import "base/cocoa_protocols_mac.h" |
| 8 #import "chrome/browser/cocoa/gradient_button_cell.h" | 9 #import "chrome/browser/cocoa/gradient_button_cell.h" |
| 9 | 10 |
| 10 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 11 | 12 |
| 12 class BaseDownloadItemModel; | 13 class BaseDownloadItemModel; |
| 13 | 14 |
| 14 // A button cell that implements the weird button/popup button hybrid that is | 15 // A button cell that implements the weird button/popup button hybrid that is |
| 15 // used by the download items. | 16 // used by the download items. |
| 16 | 17 |
| 17 // The button represented by this cell consists of a button part on the left | 18 // The button represented by this cell consists of a button part on the left |
| 18 // and a dropdown-menu part on the right. This enum describes which part the | 19 // and a dropdown-menu part on the right. This enum describes which part the |
| 19 // mouse cursor is over currently. | 20 // mouse cursor is over currently. |
| 20 enum DownloadItemMousePosition { | 21 enum DownloadItemMousePosition { |
| 21 kDownloadItemMouseOutside, | 22 kDownloadItemMouseOutside, |
| 22 kDownloadItemMouseOverButtonPart, | 23 kDownloadItemMouseOverButtonPart, |
| 23 kDownloadItemMouseOverDropdownPart | 24 kDownloadItemMouseOverDropdownPart |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 @interface DownloadItemCell : GradientButtonCell { | 27 @interface DownloadItemCell : GradientButtonCell<NSAnimationDelegate> { |
| 27 @private | 28 @private |
| 28 // Track which part of the button the mouse is over | 29 // Track which part of the button the mouse is over |
| 29 DownloadItemMousePosition mousePosition_; | 30 DownloadItemMousePosition mousePosition_; |
| 30 int mouseInsideCount_; | 31 int mouseInsideCount_; |
| 31 scoped_nsobject<NSTrackingArea> trackingAreaButton_; | 32 scoped_nsobject<NSTrackingArea> trackingAreaButton_; |
| 32 scoped_nsobject<NSTrackingArea> trackingAreaDropdown_; | 33 scoped_nsobject<NSTrackingArea> trackingAreaDropdown_; |
| 33 | 34 |
| 34 FilePath downloadPath_; // stored unelided | 35 FilePath downloadPath_; // stored unelided |
| 35 NSString* secondaryTitle_; | 36 NSString* secondaryTitle_; |
| 36 NSFont* secondaryFont_; | 37 NSFont* secondaryFont_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 49 @property (retain) NSFont* secondaryFont; | 50 @property (retain) NSFont* secondaryFont; |
| 50 | 51 |
| 51 // Valid to call in response to a click of the cell's button. Returns if the | 52 // Valid to call in response to a click of the cell's button. Returns if the |
| 52 // button part of the cell was clicked. | 53 // button part of the cell was clicked. |
| 53 - (BOOL)isButtonPartPressed; | 54 - (BOOL)isButtonPartPressed; |
| 54 | 55 |
| 55 @end | 56 @end |
| 56 | 57 |
| 57 #endif // CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_CELL_H_ | 58 #endif // CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_CELL_H_ |
| 58 | 59 |
| OLD | NEW |