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

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

Issue 2562863002: [Mac] Prevent omnibox text bg from drawing over decoration, focus ring. (Closed)
Patch Set: Created 4 years 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 bfd36c11934ffeafa2f50d92b86e64fe6c527eb3..91bc402bde8ff5b71a8e8de464672df461ab74a1 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
@@ -375,6 +375,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;
@@ -382,20 +386,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