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

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

Issue 2610033003: [Mac] Prevent omnibox text bg from drawing over decoration, focus ring.
Patch Set: Created 3 years, 12 months 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
index 799f2ef489186ecf2990d418695eb49000fda86b..5fdf52146033d6bf92b6167857b69385e4b78346 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
@@ -364,6 +364,10 @@ size_t CalculatePositionsInFrame(
}
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
+ ui::ScopedCGContextSmoothFonts fontSmoothing;
+ [super drawInteriorWithFrame:cellFrame inView:controlView];
+
+ // NOTE: This method must closely match the logic in |-textFrameForFrame:|.
std::vector<LocationBarDecoration*> decorations;
std::vector<NSRect> decorationFrames;
NSRect workingFrame;
@@ -371,20 +375,15 @@ size_t CalculatePositionsInFrame(
CalculatePositionsInFrame(cellFrame, leftDecorations_, rightDecorations_,
&decorations, &decorationFrames, &workingFrame);
- // Draw the decorations.
+ // Draw the decorations. Do this after drawing the interior because the
+ // field editor's background rect overlaps the right edge of the security
+ // decoration's hover rounded rect.
for (size_t i = 0; i < decorations.size(); ++i) {
if (decorations[i]) {
decorations[i]->DrawWithBackgroundInFrame(decorationFrames[i],
controlView);
}
}
-
- // NOTE: This function must closely match the logic in
- // |-textFrameForFrame:|.
-
- // Superclass draws text portion WRT original |cellFrame|.
- ui::ScopedCGContextSmoothFonts fontSmoothing;
- [super drawInteriorWithFrame:cellFrame inView:controlView];
}
- (BOOL)canDropAtLocationInWindow:(NSPoint)location
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698