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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_view_mac.mm

Issue 1608001: [Mac] Line up omnibox popup under field. (Closed)
Patch Set: Wordsmith and test fix. Created 10 years, 9 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/cocoa/autocomplete_text_field_cell.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6407475be30ad990dd820caf14c61a8d59215d1a..973ed67235e8826c1c6cdf9d25c54eb400ba80fc 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
@@ -15,6 +15,7 @@
#include "gfx/rect.h"
#include "grit/theme_resources.h"
#import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
+#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h"
namespace {
@@ -31,7 +32,7 @@ const int kCellHeightAdjust = 7.0;
const CGFloat kPopupRoundingRadius = 3.5;
// Gap between the field and the popup.
-const CGFloat kPopupFieldGap = 2.0;
+const CGFloat kPopupFieldGap = 0.0;
// How opaque the popup window should be. This matches Windows (see
// autocomplete_popup_contents_view.cc, kGlassPopupTransparency).
@@ -665,10 +666,15 @@ void AutocompletePopupViewMac::OpenURLForRow(int row, bool force_background) {
// This handles drawing the decorations of the rounded popup window,
// calling on NSMatrix to draw the actual contents.
- (void)drawRect:(NSRect)rect {
+ // Apparently this expects flipped coordinates, because in order to
+ // round the bottom corners visually, I need to specify the top
+ // corners here.
NSBezierPath* path =
- [NSBezierPath bezierPathWithRoundedRect:[self bounds]
- xRadius:kPopupRoundingRadius
- yRadius:kPopupRoundingRadius];
+ [NSBezierPath gtm_bezierPathWithRoundRect:[self bounds]
+ topLeftCornerRadius:kPopupRoundingRadius
+ topRightCornerRadius:kPopupRoundingRadius
+ bottomLeftCornerRadius:0.0
+ bottomRightCornerRadius:0.0];
// Draw the matrix clipped to our border.
[NSGraphicsContext saveGraphicsState];
« no previous file with comments | « no previous file | chrome/browser/cocoa/autocomplete_text_field_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698