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..252cab907a329d788e8dfee0b49948416a9480b5 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; |
Scott Hess - ex-Googler
2015/05/21 20:40:26
Instead of (id) use (instancetype). The reason is
dschuyler
2015/05/26 18:40:19
Done.
|
+ |
+- (void)drawMatchWithFrame:(NSRect)cellFrame |
+ inCell:(OmniboxPopupCell*)cell |
+ inView:(NSView*)controlView; |
Scott Hess - ex-Googler
2015/05/21 20:40:26
This can probably be -drawWithFrame:inCell:inView:
dschuyler
2015/05/26 18:40:19
Done.
|
+ |
+- (CGFloat)rowHeight; |
Scott Hess - ex-Googler
2015/05/21 20:40:26
This one could use a comment, since there's not an
|
- (void)setMaxMatchContentsWidth:(CGFloat)maxMatchContentsWidth; |
@@ -49,6 +53,13 @@ class OmniboxPopupViewMac; |
// Returns the width of the match contents. |
- (CGFloat)getMatchContentsWidth; |
+@end |
+ |
+// OmniboxPopupCell overrides how backgrounds are displayed to |
+// handle hover versus selected. |
Scott Hess - ex-Googler
2015/05/21 20:40:26
This comment seems inadequate, since it does more
dschuyler
2015/05/26 18:40:19
Done.
|
+@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. |