| Index: content/browser/web_contents/web_contents_view_mac.mm
|
| diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
|
| index 5d079a58b01e6d9a706a13cee21c16400e424f37..da315745e62461a525c65a876da17f09081a1069 100644
|
| --- a/content/browser/web_contents/web_contents_view_mac.mm
|
| +++ b/content/browser/web_contents/web_contents_view_mac.mm
|
| @@ -118,13 +118,15 @@ gfx::NativeWindow WebContentsViewMac::GetTopLevelNativeWindow() const {
|
| }
|
|
|
| void WebContentsViewMac::GetContainerBounds(gfx::Rect* out) const {
|
| - // Convert bounds to window coordinate space.
|
| - NSRect bounds =
|
| - [cocoa_view_.get() convertRect:[cocoa_view_.get() bounds] toView:nil];
|
| -
|
| - // Convert bounds to screen coordinate space.
|
| NSWindow* window = [cocoa_view_.get() window];
|
| - bounds.origin = [window convertBaseToScreen:bounds.origin];
|
| + NSRect bounds = [cocoa_view_.get() bounds];
|
| + if (window) {
|
| + // Convert bounds to window coordinate space.
|
| + bounds = [cocoa_view_.get() convertRect:bounds toView:nil];
|
| +
|
| + // Convert bounds to screen coordinate space.
|
| + bounds = [window convertRectToScreen:bounds];
|
| + }
|
|
|
| // Flip y to account for screen flip.
|
| NSScreen* screen = [[NSScreen screens] firstObject];
|
|
|