summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bubble_controller.mm
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 03:36:36 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 03:36:36 +0000
commitd1c90bf7270eb0dd62e1e4924d55bd97636762f0 (patch)
tree5bcafcd0b5d28e3a9000ce0a64a8d487359e5e35 /chrome/browser/cocoa/bookmark_bubble_controller.mm
parent5e81ea70d1c32614b5cb438b05bd2bc8c057fb72 (diff)
downloadchromium_src-d1c90bf7270eb0dd62e1e4924d55bd97636762f0.zip
chromium_src-d1c90bf7270eb0dd62e1e4924d55bd97636762f0.tar.gz
chromium_src-d1c90bf7270eb0dd62e1e4924d55bd97636762f0.tar.bz2
Change how the calculation is performed for determining the location of the arrow tip in a bubble window.
BUG=40406 TEST=1) Not in full-screen and with language set to English, press Cmd-D and verify bubble is properly positioned with arrow tip pointing to star. Change language to Espanol and repeat test. 2) Now in full-screen, repeat the tests. Review URL: http://codereview.chromium.org/1623002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43694 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bubble_controller.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bubble_controller.mm12
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.mm b/chrome/browser/cocoa/bookmark_bubble_controller.mm
index c3b7cd0..465691e 100644
--- a/chrome/browser/cocoa/bookmark_bubble_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bubble_controller.mm
@@ -98,15 +98,17 @@
[BrowserWindowController browserWindowControllerForWindow:parentWindow_];
[bwc lockBarVisibilityForOwner:self withAnimation:NO delay:NO];
NSWindow* window = [self window]; // completes nib load
+ [bubble_ setArrowLocation:kTopRight];
// Insure decent positioning even in the absence of a browser controller,
// which will occur for some unit tests.
- NSPoint topRight = bwc ? [bwc topRightForBubble] :
+ NSPoint arrowtip = bwc ? [bwc pointForBubbleArrowTip] :
NSMakePoint([window frame].size.width, [window frame].size.height);
- NSPoint origin = [parentWindow_ convertBaseToScreen:topRight];
- origin.y -= NSHeight([window frame]);
- origin.x -= NSWidth([window frame]);
+ NSPoint origin = [parentWindow_ convertBaseToScreen:arrowtip];
+ NSPoint bubbleArrowtip = [bubble_ arrowTip];
+ bubbleArrowtip = [bubble_ convertPoint:bubbleArrowtip toView:nil];
+ origin.y -= bubbleArrowtip.y;
+ origin.x -= bubbleArrowtip.x;
[window setFrameOrigin:origin];
- [bubble_ setArrowLocation:kTopRight];
[parentWindow_ addChildWindow:window ordered:NSWindowAbove];
// Default is IDS_BOOMARK_BUBBLE_PAGE_BOOKMARK; "Bookmark".
// If adding for the 1st time the string becomes "Bookmark Added!"