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_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 | 7 |
8 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" | 8 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" |
9 | 9 |
10 @class BookmarkContextMenuCocoaController; | 10 @class BookmarkContextMenuCocoaController; |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Text color for title. | 38 // Text color for title. |
39 base::scoped_nsobject<NSColor> textColor_; | 39 base::scoped_nsobject<NSColor> textColor_; |
40 } | 40 } |
41 | 41 |
42 @property(nonatomic, readwrite, assign) | 42 @property(nonatomic, readwrite, assign) |
43 const bookmarks::BookmarkNode* bookmarkNode; | 43 const bookmarks::BookmarkNode* bookmarkNode; |
44 @property(nonatomic, readwrite, assign) int startingChildIndex; | 44 @property(nonatomic, readwrite, assign) int startingChildIndex; |
45 @property(nonatomic, readwrite, assign) BOOL drawFolderArrow; | 45 @property(nonatomic, readwrite, assign) BOOL drawFolderArrow; |
46 | 46 |
| 47 // Returns the width of a cell for the given node and image for |
| 48 // display on the bookmark bar (meaning no arrow for folder |
| 49 // nodes). Used for laying out bookmark bar without creating |
| 50 // live cells. |
| 51 + (CGFloat)cellWidthForNode:(const bookmarks::BookmarkNode*)node |
| 52 image:(NSImage*)image; |
| 53 |
47 // Create a button cell which draws with a theme. | 54 // Create a button cell which draws with a theme. |
48 + (id)buttonCellForNode:(const bookmarks::BookmarkNode*)node | 55 + (id)buttonCellForNode:(const bookmarks::BookmarkNode*)node |
49 text:(NSString*)text | 56 text:(NSString*)text |
50 image:(NSImage*)image | 57 image:(NSImage*)image |
51 menuController:(BookmarkContextMenuCocoaController*)menuController; | 58 menuController:(BookmarkContextMenuCocoaController*)menuController; |
52 | 59 |
53 // Create a button cell not attached to any node which draws with a theme. | 60 // Create a button cell not attached to any node which draws with a theme. |
54 + (id)buttonCellWithText:(NSString*)text | 61 + (id)buttonCellWithText:(NSString*)text |
55 image:(NSImage*)image | 62 image:(NSImage*)image |
56 menuController:(BookmarkContextMenuCocoaController*)menuController; | 63 menuController:(BookmarkContextMenuCocoaController*)menuController; |
(...skipping 23 matching lines...) Expand all Loading... |
80 // a BookmarkButtonCell, and align the image to the left (NSImageLeft) | 87 // a BookmarkButtonCell, and align the image to the left (NSImageLeft) |
81 // if there is text in the title, and centered (NSImageCenter) if | 88 // if there is text in the title, and centered (NSImageCenter) if |
82 // there is not. If |title| is nil, do not reset the title. | 89 // there is not. If |title| is nil, do not reset the title. |
83 - (void)setBookmarkCellText:(NSString*)title | 90 - (void)setBookmarkCellText:(NSString*)title |
84 image:(NSImage*)image; | 91 image:(NSImage*)image; |
85 | 92 |
86 // Set the color of text in this cell. | 93 // Set the color of text in this cell. |
87 - (void)setTextColor:(NSColor*)color; | 94 - (void)setTextColor:(NSColor*)color; |
88 | 95 |
89 - (BOOL)isFolderButtonCell; | 96 - (BOOL)isFolderButtonCell; |
| 97 - (void)setBookmarkNode:(const bookmarks::BookmarkNode*)node |
| 98 image:(NSImage*)image; |
90 | 99 |
91 @end | 100 @end |
92 | 101 |
93 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ | 102 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ |
OLD | NEW |