| 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 1d01ac835dbe810121a24de1a4014f1bd4de4307..96b76b72252b9aaa5c257ac7b0983e8123632b87 100644
|
| --- a/content/browser/web_contents/web_contents_view_mac.mm
|
| +++ b/content/browser/web_contents/web_contents_view_mac.mm
|
| @@ -154,17 +154,22 @@ - (void)viewDidBecomeFirstResponder:(NSNotification*)notification;
|
| }
|
|
|
| void WebContentsViewMac::GetContainerBounds(gfx::Rect* out) const {
|
| - NSWindow* window = [cocoa_view_.get() window];
|
| - 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];
|
| + // Note: This implementation should pretty much do the exact same thing that
|
| + // is found in RenderWidgetHostViewMac::GetViewBounds().
|
| +
|
| + const NSRect bounds = [cocoa_view_.get() bounds];
|
| + const gfx::Size size(NSWidth(bounds), NSHeight(bounds));
|
| + NSWindow* const window = [cocoa_view_.get() window];
|
| + if (!window) {
|
| + *out = gfx::Rect(size);
|
| + return;
|
| }
|
|
|
| - *out = gfx::ScreenRectFromNSRect(bounds);
|
| + NSRect boundsInScreen = [cocoa_view_.get() convertRect:bounds toView:nil];
|
| + boundsInScreen = [window convertRectToScreen:boundsInScreen];
|
| + const gfx::Point origin = gfx::ScreenRectFromNSRect(boundsInScreen).origin();
|
| +
|
| + *out = gfx::Rect(origin, size);
|
| }
|
|
|
| void WebContentsViewMac::StartDragging(
|
|
|