Chromium Code Reviews| Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h |
| diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h |
| index 7fa83f069d7aa802a2432655d5e5530ce5651768..2a5828b424109f01d1fefbb9ba55225548d0ff3f 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h |
| +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h |
| @@ -10,6 +10,7 @@ |
| #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" |
| @class AutocompleteTextField; |
| +@class CrTrackingArea; |
|
Robert Sesek
2016/11/11 19:35:07
Unused in this file?
spqchan
2016/11/12 00:36:19
Done.
|
| class LocationBarDecoration; |
| // AutocompleteTextFieldCell extends StyledTextFieldCell to provide support for |
| @@ -24,6 +25,9 @@ class LocationBarDecoration; |
| std::vector<LocationBarDecoration*> leftDecorations_; |
| std::vector<LocationBarDecoration*> rightDecorations_; |
| + // Decorations with tracking areas attached to the AutocompleteTextField. |
| + std::vector<LocationBarDecoration*> mouseTrackingDecorations_; |
| + |
| // If YES then the text field will not draw a focus ring or show the insertion |
| // pointer. |
| BOOL hideFocusState_; |
| @@ -44,6 +48,9 @@ class LocationBarDecoration; |
| // Line height used for text in this cell. |
| - (CGFloat)lineHeight; |
| +// Remove all of the tracking areas. |
| +- (void)clearTrackingArea; |
| + |
| // Clear |leftDecorations_| and |rightDecorations_|. |
| - (void)clearDecorations; |
| @@ -95,15 +102,22 @@ class LocationBarDecoration; |
| inRect:(NSRect)cellFrame |
| ofView:(AutocompleteTextField*)controlView; |
| +// Called by |AutocompleteTextField| to pass the mouse up event to the omnibox |
| +// decorations. |
| +- (void)mouseUp:(NSEvent*)theEvent |
| + inRect:(NSRect)cellFrame |
| + ofView:(AutocompleteTextField*)controlView; |
| + |
| // Overridden from StyledTextFieldCell to include decorations adjacent |
| // to the text area which don't handle mouse clicks themselves. |
| // Keyword-search bubble, for instance. |
| - (NSRect)textCursorFrameForFrame:(NSRect)cellFrame; |
| -// Setup decoration tooltips on |controlView| by calling |
| -// |-addToolTip:forRect:|. |
| -- (void)updateToolTipsInRect:(NSRect)cellFrame |
| - ofView:(AutocompleteTextField*)controlView; |
| +// Setup decoration tooltips and mouse tracking on |controlView| by calling |
| +// |-addToolTip:forRect:| and |SetupTrackingArea()|. |
| +- (void)updateMouseTrackingAndToolTipsInRect:(NSRect)cellFrame |
| + ofView: |
| + (AutocompleteTextField*)controlView; |
| // Gets and sets |hideFocusState|. This allows the text field to have focus but |
| // to appear unfocused. |
| @@ -115,3 +129,11 @@ class LocationBarDecoration; |
| - (void)handleFocusEvent:(NSEvent*)event |
| ofView:(AutocompleteTextField*)controlView; |
| @end |
| + |
| +// Methods which are either only for testing, or only public for testing. |
| +@interface AutocompleteTextFieldCell (TestingAPI) |
| + |
| +// Returns |mouseTrackingDecorations_|. |
| +- (std::vector<LocationBarDecoration*>)mouseTrackingDecorations; |
|
Robert Sesek
2016/11/11 19:35:07
Return as const& ?
spqchan
2016/11/12 00:36:19
Done.
|
| + |
| +@end |