Index: chrome/browser/tab_contents/tab_contents_view_mac.mm |
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm |
index 6f71e3a9bb9a3b2161020757ed37b461effe759d..e2c4b8b6a23f185452786b983d717698a2e4a4ca 100644 |
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm |
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm |
@@ -149,7 +149,14 @@ gfx::NativeWindow TabContentsViewMac::GetTopLevelNativeWindow() const { |
} |
void TabContentsViewMac::GetContainerBounds(gfx::Rect* out) const { |
- *out = [cocoa_view_.get() flipNSRectToRect:[cocoa_view_.get() bounds]]; |
+ NSPoint origin = [[cocoa_view_.get() window] frame].origin; |
Avi (use Gerrit)
2011/11/12 01:42:00
This line gets the window origin in global coordin
|
+ |
+ // Flip coordinates based on the primary screen. |
+ NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
+ NSSize size = [cocoa_view_.get() frame].size; |
Avi (use Gerrit)
2011/11/12 01:42:00
...and this line gets the size of the view in its
|
+ origin.y = [screen frame].size.height - origin.y - size.height; |
Avi (use Gerrit)
2011/11/12 01:42:00
...and this line mixes up values from two totally
|
+ NSRect bounds = NSMakeRect(origin.x, origin.y, size.width, size.height); |
Avi (use Gerrit)
2011/11/12 01:42:00
...as does this line. What is GetContainerBounds s
|
+ *out = gfx::Rect(NSRectToCGRect(bounds)); |
} |
void TabContentsViewMac::StartDragging( |