Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_popup_view_mac.mm |
| diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm |
| index 6cc22069f915f36e0c0da79bc953f5610ed9f8e3..950a4e21d1ea5255a1a164e03c1099c80484a8ec 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm |
| +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm |
| @@ -294,9 +294,12 @@ void AutocompletePopupViewMac::CreatePopupIfNeeded() { |
| backing:NSBackingStoreBuffered |
| defer:YES]); |
| [popup_ setMovableByWindowBackground:NO]; |
| - // The window will have rounded borders. |
| + // The window shape is determined by the content view |
| + // (AutocompleteMatrix). |
| [popup_ setAlphaValue:1.0]; |
| [popup_ setOpaque:NO]; |
| + [popup_ setBackgroundColor:[NSColor clearColor]]; |
| + [popup_ setHasShadow:YES]; |
| [popup_ setLevel:NSNormalWindowLevel]; |
| AutocompleteMatrix* matrix = |
| @@ -631,20 +634,15 @@ void AutocompletePopupViewMac::OnMiddleClick() { |
| middleClickAction_ = anAction; |
| } |
| +- (BOOL)isOpaque { |
| + return NO; |
| +} |
|
Scott Hess - ex-Googler
2009/09/03 18:45:12
Oops - looks like I had forgotten a bit in my clea
|
| + |
| // This handles drawing the decorations of the rounded popup window, |
| // calling on NSMatrix to draw the actual contents. |
| - (void)drawRect:(NSRect)rect { |
| - // Background clear so we can round the corners. |
| - [[NSColor clearColor] set]; |
| - NSRectFill([self frame]); |
| - |
| - // The toolbar items we're mirroring for shape are inset slightly |
| - // for width. I don't know why, which is why I didn't make this a |
| - // constant, yet. The factor of 0.5 on both dimensions is to put |
| - // the stroke down the middle of the pixels. |
| - const NSRect border(NSInsetRect([self bounds], 1.5, 0.5)); |
| NSBezierPath* path = |
| - [NSBezierPath bezierPathWithRoundedRect:border |
| + [NSBezierPath bezierPathWithRoundedRect:[self bounds] |
| xRadius:kPopupRoundingRadius |
| yRadius:kPopupRoundingRadius]; |
| @@ -653,12 +651,6 @@ void AutocompletePopupViewMac::OnMiddleClick() { |
| [path addClip]; |
| [super drawRect:rect]; |
| [NSGraphicsContext restoreGraphicsState]; |
| - |
| - // Put a border over that. |
| - // TODO(shess): Theme the color? |
| - [[NSColor lightGrayColor] setStroke]; |
| - [path setLineWidth:1.0]; |
| - [path stroke]; |
| } |
| @end |