Index: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h |
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h |
index 7e60da9b87daaf4e9f65645f91dc234d5a13ec9d..2f84e100409c27a43628b8625a1db2dbad3f1be2 100644 |
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h |
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h |
@@ -11,20 +11,12 @@ |
#include "components/omnibox/autocomplete_match.h" |
class OmniboxPopupViewMac; |
+@class OmniboxPopupCell; |
groby-ooo-7-16
2015/06/11 01:22:17
I don't think you need that any more
dschuyler
2015/06/11 22:34:22
Done.
|
-// OmniboxPopupCell overrides how backgrounds are displayed to |
-// handle hover versus selected. So long as we're in there, it also |
-// provides some default initialization. |
-@interface OmniboxPopupCell : NSButtonCell { |
+@interface OmniboxPopupCellData : NSObject<NSCopying> { |
@private |
- // The popup view parent of this cell. |
- OmniboxPopupViewMac* parent_; |
- |
- // The match which will be rendered for this row in omnibox dropdown. |
- AutocompleteMatch match_; |
- |
// NSAttributedString instances for various match components. |
- base::scoped_nsobject<NSAttributedString> separator_; |
+ base::scoped_nsobject<NSAttributedString> contents_; |
groby-ooo-7-16
2015/06/11 01:22:17
If you use these purely as data container and noth
dschuyler
2015/06/11 22:34:22
Done.
|
base::scoped_nsobject<NSAttributedString> description_; |
base::scoped_nsobject<NSImage> answerImage_; |
@@ -35,18 +27,25 @@ class OmniboxPopupViewMac; |
// which accesses the |NSAttributedString| instance. |
base::scoped_nsobject<NSAttributedString> prefix_; |
+ base::scoped_nsobject<NSImage> image_; |
+ |
// The width of widest match contents in a set of infinite suggestions. |
CGFloat maxMatchContentsWidth_; |
// The offset at which the infinite suggestion contents should be displayed. |
CGFloat contentsOffset_; |
+ |
+ bool isContentsRTL_; |
+ AutocompleteMatch::Type matchType_; |
} |
-- (void)setAnswerImage:(NSImage*)image; |
+- (instancetype)initWithMatch:(const AutocompleteMatch&)match |
+ image:(NSImage*)image; |
-- (void)setMatch:(const AutocompleteMatch&)match; |
+// Each row is allowed to have a different value. |
+- (CGFloat)rowHeight; |
-- (NSAttributedString*)description; |
+- (void)setAnswerImage:(NSImage*)image; |
- (void)setMaxMatchContentsWidth:(CGFloat)maxMatchContentsWidth; |
@@ -55,6 +54,18 @@ class OmniboxPopupViewMac; |
// Returns the width of the match contents. |
- (CGFloat)getMatchContentsWidth; |
+@end |
+ |
+// OmniboxPopupCell overrides how cells are displayed. The OmniboxPopupCell |
+// uses information from OmniboxPopupCellData to draw suggestion results. |
+@interface OmniboxPopupCell : NSCell { |
+ base::scoped_nsobject<NSAttributedString> separator_; |
+} |
+ |
+- (void)drawMatchWithFrame:(NSRect)cellFrame |
+ withCellData:(OmniboxPopupCellData*)cellData |
+ inView:(NSView*)controlView; |
+ |
// Returns the offset of the start of the contents in the input text for the |
// given match. It is costly to compute this offset, so it is computed once and |
// shared by all OmniboxPopupCell instances through OmniboxPopupViewMac parent. |