| 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" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Is this suggestion an answer or calculator result. | 38 // Is this suggestion an answer or calculator result. |
| 39 bool isAnswer_; | 39 bool isAnswer_; |
| 40 | 40 |
| 41 AutocompleteMatch::Type matchType_; | 41 AutocompleteMatch::Type matchType_; |
| 42 } | 42 } |
| 43 | 43 |
| 44 @property(readonly, retain, nonatomic) NSAttributedString* contents; | 44 @property(readonly, retain, nonatomic) NSAttributedString* contents; |
| 45 @property(readonly, retain, nonatomic) NSAttributedString* description; | 45 @property(readonly, retain, nonatomic) NSAttributedString* description; |
| 46 @property(readonly, retain, nonatomic) NSAttributedString* prefix; | 46 @property(readonly, retain, nonatomic) NSAttributedString* prefix; |
| 47 @property(readonly, retain, nonatomic) NSImage* image; | 47 @property(readonly, retain, nonatomic) NSImage* image; |
| 48 @property(retain, nonatomic) NSImage* incognitoImage; |
| 48 @property(readonly, retain, nonatomic) NSImage* answerImage; | 49 @property(readonly, retain, nonatomic) NSImage* answerImage; |
| 49 @property(readonly, nonatomic) CGFloat contentsOffset; | 50 @property(readonly, nonatomic) CGFloat contentsOffset; |
| 50 @property(readonly, nonatomic) BOOL isContentsRTL; | 51 @property(readonly, nonatomic) BOOL isContentsRTL; |
| 51 @property(readonly, nonatomic) bool isAnswer; | 52 @property(readonly, nonatomic) bool isAnswer; |
| 52 @property(readonly, nonatomic) AutocompleteMatch::Type matchType; | 53 @property(readonly, nonatomic) AutocompleteMatch::Type matchType; |
| 53 | 54 |
| 54 - (instancetype)initWithMatch:(const AutocompleteMatch&)match | 55 - (instancetype)initWithMatch:(const AutocompleteMatch&)match |
| 55 contentsOffset:(CGFloat)contentsOffset | 56 contentsOffset:(CGFloat)contentsOffset |
| 56 image:(NSImage*)image | 57 image:(NSImage*)image |
| 57 answerImage:(NSImage*)answerImage; | 58 answerImage:(NSImage*)answerImage |
| 59 forDarkTheme:(BOOL)isDarkTheme; |
| 58 | 60 |
| 59 // Returns the width of the match contents. | 61 // Returns the width of the match contents. |
| 60 - (CGFloat)getMatchContentsWidth; | 62 - (CGFloat)getMatchContentsWidth; |
| 61 | 63 |
| 62 @end | 64 @end |
| 63 | 65 |
| 64 // Overrides how cells are displayed. Uses information from | 66 // Overrides how cells are displayed. Uses information from |
| 65 // OmniboxPopupCellData to draw suggestion results. | 67 // OmniboxPopupCellData to draw suggestion results. |
| 66 @interface OmniboxPopupCell : NSCell | 68 @interface OmniboxPopupCell : NSCell |
| 67 | 69 |
| 68 - (void)drawMatchWithFrame:(NSRect)cellFrame inView:(NSView*)controlView; | 70 - (void)drawMatchWithFrame:(NSRect)cellFrame inView:(NSView*)controlView; |
| 69 | 71 |
| 70 // Returns the offset of the start of the contents in the input text for the | 72 // Returns the offset of the start of the contents in the input text for the |
| 71 // given match. It is costly to compute this offset, so it is computed once and | 73 // given match. It is costly to compute this offset, so it is computed once and |
| 72 // shared by all OmniboxPopupCell instances through OmniboxPopupViewMac parent. | 74 // shared by all OmniboxPopupCell instances through OmniboxPopupViewMac parent. |
| 73 + (CGFloat)computeContentsOffset:(const AutocompleteMatch&)match; | 75 + (CGFloat)computeContentsOffset:(const AutocompleteMatch&)match; |
| 74 | 76 |
| 75 + (NSAttributedString*)createSeparatorString; | 77 + (NSAttributedString*)createSeparatorStringForDarkTheme:(BOOL)isDarkTheme; |
| 76 | 78 |
| 77 @end | 79 @end |
| 78 | 80 |
| 79 const CGFloat kContentLineHeight = 25.0; | 81 const CGFloat kContentLineHeight = 25.0; |
| 80 | 82 |
| 81 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ | 83 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_CELL_H_ |
| OLD | NEW |