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

Unified Diff: chrome/browser/cocoa/toolbar_controller.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
Index: chrome/browser/cocoa/toolbar_controller.mm
diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm
index 7a75fe78d1cf5da6d75b70c302f7fe7919baeaf8..9483000f0639b15b61fa3482fcbf1a465fce858d 100644
--- a/chrome/browser/cocoa/toolbar_controller.mm
+++ b/chrome/browser/cocoa/toolbar_controller.mm
@@ -848,26 +848,14 @@ class PrefObserverBridge : public NotificationObserver {
}
- (gfx::Rect)locationStackBounds {
- // The number of pixels from the left or right edges of the location stack to
- // "just inside the visible borders". When the omnibox bubble contents are
- // aligned with this, the visible borders tacked on to the outsides will line
- // up with the visible borders on the location stack.
- const int kLocationStackEdgeWidth = 2;
+ // The field has a single-pixel border on the left and right. This
+ // needs to be factored out so that the popup window's border (which
+ // is outside the frame) lines up.
+ const int kLocationStackEdgeWidth = 1;
const NSRect locationFrame = [locationBar_ frame];
-
- // Expand to include star and go buttons. Including the widths
- // rather that calculating from their current placement because this
- // method can be called while the resize is still rearranging the
- // views involved.
- const CGFloat minX = NSMinX(locationFrame) - NSWidth([starButton_ frame]);
- const CGFloat maxX = NSMaxX(locationFrame) + NSWidth([goButton_ frame]);
-
- NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX,
- NSHeight(locationFrame));
gfx::Rect stack_bounds(
- NSRectToCGRect([[self view] convertRect:r toView:nil]));
- // Inset the bounds to just inside the visible edges (see comment above).
+ NSRectToCGRect([[self view] convertRect:locationFrame toView:nil]));
stack_bounds.Inset(kLocationStackEdgeWidth, 0);
return stack_bounds;
}
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_cell.mm ('k') | chrome/browser/cocoa/toolbar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698