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..d6e85b04b0ab065ded72fdf391f8127935eb0bd8 100644 |
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h |
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h |
@@ -11,19 +11,12 @@ |
#include "components/omnibox/autocomplete_match.h" |
class OmniboxPopupViewMac; |
+@class OmniboxPopupCell; |
-// 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 { |
@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> contents_; |
base::scoped_nsobject<NSAttributedString> separator_; |
base::scoped_nsobject<NSAttributedString> description_; |
@@ -35,18 +28,29 @@ 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; |
+- (void)drawMatchWithFrame:(NSRect)cellFrame |
+ inCell:(OmniboxPopupCell*)cell |
+ inView:(NSView*)controlView; |
-- (NSAttributedString*)description; |
+// Each row is allowed to have a different value. |
+- (CGFloat)rowHeight; |
+ |
+- (void)setAnswerImage:(NSImage*)image; |
- (void)setMaxMatchContentsWidth:(CGFloat)maxMatchContentsWidth; |
@@ -55,6 +59,13 @@ 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 { |
+} |
+ |
// 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. |