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 486df2c83f31c1f571e2396ef7c972ab2c5a1880..34eb47fdcfcfa20eb1cb42d343e33695b7ad3bc8 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_; |
@@ -33,14 +26,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)setMatch:(const AutocompleteMatch&)match; |
+- (id)initWithMatch:(const AutocompleteMatch&)match image:(NSImage*)image; |
+ |
+- (void)drawMatchWithFrame:(NSRect)cellFrame |
+ inCell:(OmniboxPopupCell*)cell |
+ inView:(NSView*)controlView; |
+ |
+- (CGFloat)rowHeight; |
- (void)setMaxMatchContentsWidth:(CGFloat)maxMatchContentsWidth; |
@@ -49,6 +53,18 @@ class OmniboxPopupViewMac; |
// Returns the width of the match contents. |
- (CGFloat)getMatchContentsWidth; |
+@end |
+ |
+// 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 : NSCell { |
groby-ooo-7-16
2015/05/20 01:02:30
NSCell already has a concept of an objectValue - c
dschuyler
2015/05/21 00:38:39
The objectValue requires that the value be parse-a
groby-ooo-7-16
2015/05/21 03:01:47
You'd _think_ it has to be parsable, but it doesn'
dschuyler
2015/05/26 18:40:19
That makes sense. Should I change it from represe
groby-ooo-7-16
2015/05/26 21:23:22
Yes, please. -representedObject is the wrong choic
dschuyler
2015/05/28 20:34:22
I love it when stuff is done for my convenience.
|
+ @private |
+ base::scoped_nsobject<OmniboxPopupCellData> cellData_; |
+} |
+ |
+- (void)setCellData:(OmniboxPopupCellData*)cellData; |
+ |
// 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. |