summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/status_bubble_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/status_bubble_mac.mm')
-rw-r--r--chrome/browser/cocoa/status_bubble_mac.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/status_bubble_mac.mm b/chrome/browser/cocoa/status_bubble_mac.mm
index 3949441..7f77029 100644
--- a/chrome/browser/cocoa/status_bubble_mac.mm
+++ b/chrome/browser/cocoa/status_bubble_mac.mm
@@ -297,7 +297,12 @@ void StatusBubbleMac::Create() {
return;
// TODO(avi):fix this for RTL
- window_ = [[NSWindow alloc] initWithContentRect:CalculateWindowFrame()
+ NSRect window_rect = CalculateWindowFrame();
+ // initWithContentRect has origin in screen coords and size in scaled window
+ // coordinates.
+ window_rect.size =
+ [[parent_ contentView] convertSize:window_rect.size fromView:nil];
+ window_ = [[NSWindow alloc] initWithContentRect:window_rect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:YES];
@@ -554,8 +559,11 @@ void StatusBubbleMac::SwitchParentWindow(NSWindow* parent) {
NSRect StatusBubbleMac::CalculateWindowFrame() {
DCHECK(parent_);
+ NSSize size = NSMakeSize(0, kWindowHeight);
+ size = [[parent_ contentView] convertSize:size toView:nil];
+
NSRect rect = [parent_ frame];
- rect.size.height = kWindowHeight;
+ rect.size.height = size.height;
rect.size.width = static_cast<int>(kWindowWidthPercent * rect.size.width);
return rect;
}