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 #ifndef CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_CELL_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_CELL_H_ |
6 #define CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_CELL_H_ | 6 #define CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_CELL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" | 9 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 kDownloadItemMouseOutside, | 23 kDownloadItemMouseOutside, |
24 kDownloadItemMouseOverButtonPart, | 24 kDownloadItemMouseOverButtonPart, |
25 kDownloadItemMouseOverDropdownPart | 25 kDownloadItemMouseOverDropdownPart |
26 }; | 26 }; |
27 | 27 |
28 @interface DownloadItemCell : GradientButtonCell<NSAnimationDelegate> { | 28 @interface DownloadItemCell : GradientButtonCell<NSAnimationDelegate> { |
29 @private | 29 @private |
30 // Track which part of the button the mouse is over | 30 // Track which part of the button the mouse is over |
31 DownloadItemMousePosition mousePosition_; | 31 DownloadItemMousePosition mousePosition_; |
32 int mouseInsideCount_; | 32 int mouseInsideCount_; |
33 scoped_nsobject<NSTrackingArea> trackingAreaButton_; | 33 base::scoped_nsobject<NSTrackingArea> trackingAreaButton_; |
34 scoped_nsobject<NSTrackingArea> trackingAreaDropdown_; | 34 base::scoped_nsobject<NSTrackingArea> trackingAreaDropdown_; |
35 | 35 |
36 base::FilePath downloadPath_; // stored unelided | 36 base::FilePath downloadPath_; // stored unelided |
37 NSString* secondaryTitle_; | 37 NSString* secondaryTitle_; |
38 NSFont* secondaryFont_; | 38 NSFont* secondaryFont_; |
39 int percentDone_; | 39 int percentDone_; |
40 scoped_nsobject<NSAnimation> completionAnimation_; | 40 base::scoped_nsobject<NSAnimation> completionAnimation_; |
41 | 41 |
42 // In degrees, for downloads with no known total size. | 42 // In degrees, for downloads with no known total size. |
43 int indeterminateProgressAngle_; | 43 int indeterminateProgressAngle_; |
44 scoped_nsobject<IndeterminateProgressTimer> indeterminateProgressTimer_; | 44 base::scoped_nsobject<IndeterminateProgressTimer> indeterminateProgressTimer_; |
45 | 45 |
46 BOOL isStatusTextVisible_; | 46 BOOL isStatusTextVisible_; |
47 CGFloat titleY_; | 47 CGFloat titleY_; |
48 CGFloat statusAlpha_; | 48 CGFloat statusAlpha_; |
49 scoped_nsobject<NSAnimation> toggleStatusVisibilityAnimation_; | 49 base::scoped_nsobject<NSAnimation> toggleStatusVisibilityAnimation_; |
50 | 50 |
51 scoped_ptr<ui::ThemeProvider> themeProvider_; | 51 scoped_ptr<ui::ThemeProvider> themeProvider_; |
52 } | 52 } |
53 | 53 |
54 @property(nonatomic, copy) NSString* secondaryTitle; | 54 @property(nonatomic, copy) NSString* secondaryTitle; |
55 @property(nonatomic, retain) NSFont* secondaryFont; | 55 @property(nonatomic, retain) NSFont* secondaryFont; |
56 | 56 |
57 - (void)setStateFromDownload:(DownloadItemModel*)downloadModel; | 57 - (void)setStateFromDownload:(DownloadItemModel*)downloadModel; |
58 | 58 |
59 // Returns if the mouse is over the button part of the cell. | 59 // Returns if the mouse is over the button part of the cell. |
60 - (BOOL)isMouseOverButtonPart; | 60 - (BOOL)isMouseOverButtonPart; |
61 | 61 |
62 @end | 62 @end |
63 | 63 |
64 @interface DownloadItemCell(TestingAPI) | 64 @interface DownloadItemCell(TestingAPI) |
65 - (BOOL)isStatusTextVisible; | 65 - (BOOL)isStatusTextVisible; |
66 - (CGFloat)statusTextAlpha; | 66 - (CGFloat)statusTextAlpha; |
67 - (void)skipVisibilityAnimation; | 67 - (void)skipVisibilityAnimation; |
68 - (void)showSecondaryTitle; | 68 - (void)showSecondaryTitle; |
69 - (void)hideSecondaryTitle; | 69 - (void)hideSecondaryTitle; |
70 - (IndeterminateProgressTimer*)indeterminateProgressTimer; | 70 - (IndeterminateProgressTimer*)indeterminateProgressTimer; |
71 @end | 71 @end |
72 | 72 |
73 #endif // CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_CELL_H_ | 73 #endif // CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_CELL_H_ |
OLD | NEW |