From d225f59c134c0be88c03f208c6cfaaa1ad4fc0b7 Mon Sep 17 00:00:00 2001 From: "paul@chromium.org" Date: Tue, 15 Sep 2009 19:25:19 +0000 Subject: Committing original patch http://codereview.chromium.org/178036 by Vassili Bykov. BUG=19983 TEST=Follow the steps in the bug to test the bubble's move-out-of-the-way behavior with dowload shelf both visible and hidden. Review URL: http://codereview.chromium.org/200135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26250 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/status_bubble_mac.mm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'chrome/browser/cocoa/status_bubble_mac.mm') diff --git a/chrome/browser/cocoa/status_bubble_mac.mm b/chrome/browser/cocoa/status_bubble_mac.mm index 529ea81..1f2ecfa 100644 --- a/chrome/browser/cocoa/status_bubble_mac.mm +++ b/chrome/browser/cocoa/status_bubble_mac.mm @@ -127,6 +127,13 @@ void StatusBubbleMac::MouseMoved() { NSRect window_frame = [window_ frame]; window_frame.origin = [parent_ frame].origin; + // Adjust the position to sit on top of download shelf. + // |delegate_| can be nil during unit tests. + if (is_download_shelf_visible_) { + if ([delegate_ respondsToSelector:@selector(verticalOffsetForStatusBubble)]) + window_frame.origin.y += [delegate_ verticalOffsetForStatusBubble]; + } + // Get the cursor position relative to the popup. cursor_location.x -= NSMaxX(window_frame); cursor_location.y -= NSMaxY(window_frame); @@ -168,12 +175,6 @@ void StatusBubbleMac::MouseMoved() { [[window_ contentView] setCornerFlags:kRoundedTopRightCorner]; } - // |delegate_| can be nil during unit tests. - if (is_download_shelf_visible_) { - if ([delegate_ respondsToSelector:@selector(verticalOffsetForStatusBubble)]) - window_frame.origin.y += [delegate_ verticalOffsetForStatusBubble]; - } - [window_ setFrame:window_frame display:YES]; } -- cgit v1.1