Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h

Issue 2478673002: [Mac] Hover/Pressed background for the Omnibox decorations (Closed)
Patch Set: nit Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b8f6543c34155ebb1b3cfac3de7657a33390dfcd 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
@@ -24,6 +24,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 +47,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 +101,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 +128,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_|.
+- (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations;
+
+@end

Powered by Google App Engine
This is Rietveld 408576698