Chromium Code Reviews| 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/objc_property_releaser.h" | |
| 10 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 11 #include "components/omnibox/browser/autocomplete_match.h" | 12 #include "components/omnibox/browser/autocomplete_match.h" |
| 12 | 13 |
| 13 class OmniboxPopupViewMac; | 14 class OmniboxPopupViewMac; |
| 14 | 15 |
| 15 @interface OmniboxPopupCellData : NSObject<NSCopying> { | 16 @interface OmniboxPopupCellData : NSObject<NSCopying> { |
| 16 @private | 17 @private |
| 17 // Left hand side of the separator (e.g. a hyphen). | 18 base::mac::ObjCPropertyReleaser propertyReleaser_OmniboxPopupCellData_; |
|
Robert Sesek
2016/08/11 15:17:03
While we're modernizing, might as well just push t
erikchen
2016/08/11 17:47:52
Done.
| |
| 18 NSAttributedString* contents_; | |
| 19 // Right hand side of the separator (e.g. a hyphen). | |
| 20 NSAttributedString* description_; | |
| 21 | |
| 22 // NOTE: While |prefix_| is used only for postfix suggestions, it still needs | |
| 23 // to be a member of the class. This allows the |NSAttributedString| instance | |
| 24 // to stay alive between the call to |drawTitle| and the actual paint event | |
| 25 // which accesses the |NSAttributedString| instance. | |
| 26 NSAttributedString* prefix_; | |
| 27 | |
| 28 // Common icon that shows next to most rows in the list. | |
| 29 NSImage* image_; | |
| 30 // Uncommon icon that only shows on answer rows (e.g. weather). | |
| 31 NSImage* answerImage_; | |
| 32 | |
| 33 // The offset at which the infinite suggestion contents should be displayed. | |
| 34 CGFloat contentsOffset_; | |
| 35 | |
| 36 BOOL isContentsRTL_; | |
| 37 | |
| 38 // Is this suggestion an answer or calculator result. | |
| 39 bool isAnswer_; | |
| 40 | |
| 41 AutocompleteMatch::Type matchType_; | |
| 42 | |
| 43 int maxLines_; | |
| 44 } | 19 } |
| 45 | 20 |
| 21 // Left hand side of the separator (e.g. a hyphen). | |
| 46 @property(readonly, retain, nonatomic) NSAttributedString* contents; | 22 @property(readonly, retain, nonatomic) NSAttributedString* contents; |
| 23 | |
| 24 // Right hand side of the separator (e.g. a hyphen). | |
| 47 @property(readonly, retain, nonatomic) NSAttributedString* description; | 25 @property(readonly, retain, nonatomic) NSAttributedString* description; |
| 26 | |
| 27 // NOTE: While |prefix_| is used only for postfix suggestions, it still needs | |
| 28 // to be a member of the class. This allows the |NSAttributedString| instance | |
| 29 // to stay alive between the call to |drawTitle| and the actual paint event | |
| 30 // which accesses the |NSAttributedString| instance. | |
| 48 @property(readonly, retain, nonatomic) NSAttributedString* prefix; | 31 @property(readonly, retain, nonatomic) NSAttributedString* prefix; |
| 32 | |
| 33 // Common icon that shows next to most rows in the list. | |
| 49 @property(readonly, retain, nonatomic) NSImage* image; | 34 @property(readonly, retain, nonatomic) NSImage* image; |
| 50 @property(retain, nonatomic) NSImage* incognitoImage; | 35 @property(retain, nonatomic) NSImage* incognitoImage; |
| 36 | |
| 37 // Uncommon icon that only shows on answer rows (e.g. weather). | |
| 51 @property(readonly, retain, nonatomic) NSImage* answerImage; | 38 @property(readonly, retain, nonatomic) NSImage* answerImage; |
| 39 | |
| 40 // The offset at which the infinite suggestion contents should be displayed. | |
| 52 @property(readonly, nonatomic) CGFloat contentsOffset; | 41 @property(readonly, nonatomic) CGFloat contentsOffset; |
| 53 @property(readonly, nonatomic) BOOL isContentsRTL; | 42 @property(readonly, nonatomic) BOOL isContentsRTL; |
| 43 | |
| 44 // Is this suggestion an answer or calculator result. | |
| 54 @property(readonly, nonatomic) bool isAnswer; | 45 @property(readonly, nonatomic) bool isAnswer; |
| 55 @property(readonly, nonatomic) AutocompleteMatch::Type matchType; | 46 @property(readonly, nonatomic) AutocompleteMatch::Type matchType; |
| 56 @property(readonly, nonatomic) int maxLines; | 47 @property(readonly, nonatomic) int maxLines; |
| 57 | 48 |
| 58 - (instancetype)initWithMatch:(const AutocompleteMatch&)match | 49 - (instancetype)initWithMatch:(const AutocompleteMatch&)match |
| 59 contentsOffset:(CGFloat)contentsOffset | 50 contentsOffset:(CGFloat)contentsOffset |
| 60 image:(NSImage*)image | 51 image:(NSImage*)image |
| 61 answerImage:(NSImage*)answerImage | 52 answerImage:(NSImage*)answerImage |
| 62 forDarkTheme:(BOOL)isDarkTheme; | 53 forDarkTheme:(BOOL)isDarkTheme; |
| 63 | 54 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 79 | 70 |
| 80 + (NSAttributedString*)createSeparatorStringForDarkTheme:(BOOL)isDarkTheme; | 71 + (NSAttributedString*)createSeparatorStringForDarkTheme:(BOOL)isDarkTheme; |
| 81 | 72 |
| 82 + (CGFloat)getContentAreaWidth:(NSRect)cellFrame; | 73 + (CGFloat)getContentAreaWidth:(NSRect)cellFrame; |
| 83 | 74 |
| 84 @end | 75 @end |
| 85 | 76 |
| 86 const CGFloat kContentLineHeight = 25.0; | 77 const CGFloat kContentLineHeight = 25.0; |
| 87 | 78 |
| 88 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ | 79 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ |
| OLD | NEW |