OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import "base/mac/cocoa_protocols.h" | 9 #import "base/mac/cocoa_protocols.h" |
10 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" | 10 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" |
11 | 11 |
12 class BookmarkNode; | 12 class BookmarkNode; |
13 | 13 |
14 // A button cell that handles drawing/highlighting of buttons in the | 14 // A button cell that handles drawing/highlighting of buttons in the |
15 // bookmark bar. This cell forwards mouseEntered/mouseExited events | 15 // bookmark bar. This cell forwards mouseEntered/mouseExited events |
16 // to its control view so that pseudo-menu operations | 16 // to its control view so that pseudo-menu operations |
17 // (e.g. hover-over to open) can be implemented. | 17 // (e.g. hover-over to open) can be implemented. |
18 @interface BookmarkButtonCell : GradientButtonCell<NSMenuDelegate> { | 18 @interface BookmarkButtonCell : GradientButtonCell<NSMenuDelegate> { |
19 @private | 19 @private |
20 BOOL empty_; // is this an "empty" button placeholder button cell? | 20 BOOL empty_; // is this an "empty" button placeholder button cell? |
21 | 21 |
22 // Starting index of bookmarkFolder children that we care to use. | 22 // Starting index of bookmarkFolder children that we care to use. |
23 int startingChildIndex_; | 23 int startingChildIndex_; |
24 | 24 |
25 // Should we draw the folder arrow as needed? Not used for the bar | |
26 // itself but used on the folder windows. | |
27 BOOL drawFolderArrow_; | |
28 | |
29 // Arrow for folders | |
30 scoped_nsobject<NSImage> arrowImage_; | |
31 | |
32 // Text color for title. | 25 // Text color for title. |
33 scoped_nsobject<NSColor> textColor_; | 26 scoped_nsobject<NSColor> textColor_; |
34 } | 27 } |
35 | 28 |
36 @property(nonatomic, readwrite, assign) const BookmarkNode* bookmarkNode; | 29 @property(nonatomic, readwrite, assign) const BookmarkNode* bookmarkNode; |
37 @property(nonatomic, readwrite, assign) int startingChildIndex; | 30 @property(nonatomic, readwrite, assign) int startingChildIndex; |
38 @property(nonatomic, readwrite, assign) BOOL drawFolderArrow; | |
39 | 31 |
40 // Create a button cell which draws with a theme. | 32 // Create a button cell which draws with a theme. |
41 + (id)buttonCellForNode:(const BookmarkNode*)node | 33 + (id)buttonCellForNode:(const BookmarkNode*)node |
42 contextMenu:(NSMenu*)contextMenu | 34 contextMenu:(NSMenu*)contextMenu |
43 cellText:(NSString*)cellText | 35 cellText:(NSString*)cellText |
44 cellImage:(NSImage*)cellImage; | 36 cellImage:(NSImage*)cellImage; |
45 | 37 |
46 // Initialize a button cell which draws with a theme. | 38 // Initialize a button cell which draws with a theme. |
47 // Designated initializer. | 39 // Designated initializer. |
48 - (id)initForNode:(const BookmarkNode*)node | 40 - (id)initForNode:(const BookmarkNode*)node |
(...skipping 12 matching lines...) Expand all Loading... |
61 image:(NSImage*)image; | 53 image:(NSImage*)image; |
62 | 54 |
63 // Set the color of text in this cell. | 55 // Set the color of text in this cell. |
64 - (void)setTextColor:(NSColor*)color; | 56 - (void)setTextColor:(NSColor*)color; |
65 | 57 |
66 - (BOOL)isFolderButtonCell; | 58 - (BOOL)isFolderButtonCell; |
67 | 59 |
68 @end | 60 @end |
69 | 61 |
70 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ | 62 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ |
OLD | NEW |