Chromium Code Reviews| 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..f64ae88aac1b5d241a1911be95f0e65fc0fc18a4 100644 |
| --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm |
| +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm |
| @@ -149,7 +149,22 @@ gfx::NativeWindow TabContentsViewMac::GetTopLevelNativeWindow() const { |
| } |
| void TabContentsViewMac::GetContainerBounds(gfx::Rect* out) const { |
| - *out = [cocoa_view_.get() flipNSRectToRect:[cocoa_view_.get() bounds]]; |
| + NSRect bounds = [cocoa_view_.get() bounds]; |
| + NSRect bounds_wrt_window = [cocoa_view_.get() convertRect:bounds toView:nil]; |
|
Avi (use Gerrit)
2011/11/14 19:18:57
bounds_wrt_window is a horrible name. Just use bou
|
| + |
| + NSWindow* window = [cocoa_view_.get() window]; |
| + NSPoint origin_wrt_screen = [ |
| + window convertBaseToScreen:bounds_wrt_window.origin]; |
|
Avi (use Gerrit)
2011/11/14 19:18:57
You can't break there. You break like:
blah blah
|
| + NSRect bounds_wrt_screen = NSMakeRect(origin_wrt_screen.x, |
|
Avi (use Gerrit)
2011/11/14 19:18:57
horrible name; change
|
| + origin_wrt_screen.y, |
| + bounds_wrt_window.size.width, |
| + bounds_wrt_window.size.height); |
| + |
| + // Flip y to account for screen flip. |
| + NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
| + bounds_wrt_screen.origin.y = [screen frame].size.height |
| + - bounds_wrt_screen.origin.y - bounds_wrt_screen.size.height; |
| + *out = gfx::Rect(NSRectToCGRect(bounds_wrt_screen)); |
|
Avi (use Gerrit)
2011/11/14 19:18:57
This is a change of functionality. Before, the bou
|
| } |
| void TabContentsViewMac::StartDragging( |