| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_OMNIBOX_OMNIBOX_POPUP_CELL_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ | 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "components/omnibox/browser/autocomplete_match.h" | 11 #include "components/omnibox/browser/autocomplete_match.h" |
| 12 | 12 |
| 13 class OmniboxPopupViewMac; | 13 class OmniboxPopupViewMac; |
| 14 | 14 |
| 15 @interface OmniboxPopupCellData : NSObject<NSCopying> | 15 @interface OmniboxPopupCellData : NSObject<NSCopying> |
| 16 | 16 |
| 17 // Left hand side of the separator (e.g. a hyphen). | 17 // Left hand side of the separator (e.g. a hyphen). |
| 18 @property(readonly, retain, nonatomic) NSAttributedString* contents; | 18 @property(readonly, retain, nonatomic) NSAttributedString* contents; |
| 19 | 19 |
| 20 // Right hand side of the separator (e.g. a hyphen). | 20 // Right hand side of the separator (e.g. a hyphen). |
| 21 @property(readonly, retain, nonatomic) NSAttributedString* description; | 21 @property(readonly, retain, nonatomic) NSAttributedString* description; |
| 22 | 22 |
| 23 // NOTE: While |prefix_| is used only for postfix suggestions, it still needs | 23 // NOTE: While |prefix_| is used only for tail suggestions, it still needs |
| 24 // to be a member of the class. This allows the |NSAttributedString| instance | 24 // to be a member of the class. This allows the |NSAttributedString| instance |
| 25 // to stay alive between the call to |drawTitle| and the actual paint event | 25 // to stay alive between the call to |drawTitle| and the actual paint event |
| 26 // which accesses the |NSAttributedString| instance. | 26 // which accesses the |NSAttributedString| instance. |
| 27 @property(readonly, retain, nonatomic) NSAttributedString* prefix; | 27 @property(readonly, retain, nonatomic) NSAttributedString* prefix; |
| 28 | 28 |
| 29 // Common icon that shows next to most rows in the list. | 29 // Common icon that shows next to most rows in the list. |
| 30 @property(readonly, retain, nonatomic) NSImage* image; | 30 @property(readonly, retain, nonatomic) NSImage* image; |
| 31 @property(retain, nonatomic) NSImage* incognitoImage; | 31 @property(retain, nonatomic) NSImage* incognitoImage; |
| 32 | 32 |
| 33 // Uncommon icon that only shows on answer rows (e.g. weather). | 33 // Uncommon icon that only shows on answer rows (e.g. weather). |
| 34 @property(readonly, retain, nonatomic) NSImage* answerImage; | 34 @property(readonly, retain, nonatomic) NSImage* answerImage; |
| 35 | 35 |
| 36 // The offset at which the infinite suggestion contents should be displayed. | 36 // The offset at which the tail suggestion contents should be displayed. |
| 37 @property(readonly, nonatomic) CGFloat contentsOffset; | 37 @property(readonly, nonatomic) CGFloat contentsOffset; |
| 38 @property(readonly, nonatomic) BOOL isContentsRTL; | 38 @property(readonly, nonatomic) BOOL isContentsRTL; |
| 39 | 39 |
| 40 // Is this suggestion an answer or calculator result. | 40 // Is this suggestion an answer or calculator result. |
| 41 @property(readonly, nonatomic) bool isAnswer; | 41 @property(readonly, nonatomic) bool isAnswer; |
| 42 @property(readonly, nonatomic) AutocompleteMatch::Type matchType; | 42 @property(readonly, nonatomic) AutocompleteMatch::Type matchType; |
| 43 @property(readonly, nonatomic) int maxLines; | 43 @property(readonly, nonatomic) int maxLines; |
| 44 | 44 |
| 45 - (instancetype)initWithMatch:(const AutocompleteMatch&)match | 45 - (instancetype)initWithMatch:(const AutocompleteMatch&)match |
| 46 contentsOffset:(CGFloat)contentsOffset | 46 contentsOffset:(CGFloat)contentsOffset |
| (...skipping 19 matching lines...) Expand all Loading... |
| 66 | 66 |
| 67 + (NSAttributedString*)createSeparatorStringForDarkTheme:(BOOL)isDarkTheme; | 67 + (NSAttributedString*)createSeparatorStringForDarkTheme:(BOOL)isDarkTheme; |
| 68 | 68 |
| 69 + (CGFloat)getContentAreaWidth:(NSRect)cellFrame; | 69 + (CGFloat)getContentAreaWidth:(NSRect)cellFrame; |
| 70 | 70 |
| 71 @end | 71 @end |
| 72 | 72 |
| 73 const CGFloat kContentLineHeight = 25.0; | 73 const CGFloat kContentLineHeight = 25.0; |
| 74 | 74 |
| 75 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ | 75 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ |
| OLD | NEW |