summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 15:09:51 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 15:09:51 +0000
commit6af4014c7c0af5efc058aa9789c9d302c2f7873a (patch)
treed71c355805e37fd01a6fdd75b5aff7c2954fa781 /chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
parent11540af83d79c15475afadf8fc98822e3c3ca2c8 (diff)
downloadchromium_src-6af4014c7c0af5efc058aa9789c9d302c2f7873a.zip
chromium_src-6af4014c7c0af5efc058aa9789c9d302c2f7873a.tar.gz
chromium_src-6af4014c7c0af5efc058aa9789c9d302c2f7873a.tar.bz2
[Mac] Plumb through the Instant and omnibox popup bounds. This will allow instant results to properly move out of the way of the omnibox.
BUG=56385 TEST=Do a Google search with Instant turned on. The omnibox should not overlap with the results. Review URL: http://codereview.chromium.org/3735005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_mac.mm')
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_mac.mm12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
index c1efe82..a6c7bb7 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
@@ -260,7 +260,8 @@ AutocompletePopupViewMac::AutocompletePopupViewMac(
: model_(new AutocompletePopupModel(this, edit_model, profile)),
edit_view_(edit_view),
field_(field),
- popup_(nil) {
+ popup_(nil),
+ targetPopupFrame_(NSZeroRect) {
DCHECK(edit_view);
DCHECK(edit_model);
DCHECK(profile);
@@ -448,6 +449,15 @@ void AutocompletePopupViewMac::UpdatePopupAppearance() {
PositionPopup(rows * cellHeight);
}
+gfx::Rect AutocompletePopupViewMac::GetTargetBounds() {
+ // Flip the coordinate system before returning.
+ NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
+ NSRect monitorFrame = [screen frame];
+ gfx::Rect bounds(NSRectToCGRect(targetPopupFrame_));
+ bounds.set_y(monitorFrame.size.height - bounds.y() - bounds.height());
+ return bounds;
+}
+
void AutocompletePopupViewMac::SetSelectedLine(size_t line) {
model_->SetSelectedLine(line, false);
}