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

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

Issue 1578021: Shift omnibox dropdown in and up on Windows, and square off the top, so it co... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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/autocomplete/autocomplete_popup_view_mac.mm
===================================================================
--- chrome/browser/autocomplete/autocomplete_popup_view_mac.mm (revision 43969)
+++ chrome/browser/autocomplete/autocomplete_popup_view_mac.mm (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,7 +10,6 @@
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h"
#include "chrome/browser/autocomplete/autocomplete_popup_model.h"
-#include "chrome/browser/bubble_positioner.h"
#include "chrome/browser/cocoa/event_utils.h"
#include "gfx/rect.h"
#include "grit/theme_resources.h"
@@ -254,12 +253,10 @@
AutocompletePopupViewMac::AutocompletePopupViewMac(
AutocompleteEditViewMac* edit_view,
AutocompleteEditModel* edit_model,
- const BubblePositioner* bubble_positioner,
Profile* profile,
NSTextField* field)
: model_(new AutocompletePopupModel(this, edit_model, profile)),
edit_view_(edit_view),
- bubble_positioner_(bubble_positioner),
field_(field),
popup_(nil) {
DCHECK(edit_view);
@@ -326,8 +323,12 @@
CreatePopupIfNeeded();
// Layout the popup and size it to land underneath the field.
- NSRect r =
- NSRectFromCGRect(bubble_positioner_->GetLocationStackBounds().ToCGRect());
+ // 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;
+ NSRect r = NSInsetRect([field_ convertRect:[field_ bounds] toView:nil],
+ kLocationStackEdgeWidth, 0);
r.origin = [[field_ window] convertBaseToScreen:r.origin];
DCHECK_GT(r.size.width, 0.0);

Powered by Google App Engine
This is Rietveld 408576698