| Index: content/browser/renderer_host/render_widget_host_view_mac.mm
|
| diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| index 79061b448a4830f99fb8958cb6b72d51a3b1ced9..79681423257ca1db220520e90791515cda526fcb 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| @@ -882,16 +882,29 @@ new BrowserCompositorMac(this, this, render_widget_host_->is_hidden(),
|
|
|
| gfx::Rect RenderWidgetHostViewMac::GetViewBounds() const {
|
| NSRect bounds = [cocoa_view_ bounds];
|
| + const gfx::Size size(NSWidth(bounds), NSHeight(bounds));
|
| // TODO(shess): In case of !window, the view has been removed from
|
| // the view hierarchy because the tab isn't main. Could retrieve
|
| // the information from the main tab for our window.
|
| NSWindow* enclosing_window = ApparentWindowForView(cocoa_view_);
|
| if (!enclosing_window)
|
| - return gfx::Rect(gfx::Size(NSWidth(bounds), NSHeight(bounds)));
|
| + return gfx::Rect(size);
|
|
|
| - bounds = [cocoa_view_ convertRect:bounds toView:nil];
|
| - bounds = [enclosing_window convertRectToScreen:bounds];
|
| - return FlipNSRectToRectScreen(bounds);
|
| + NSRect boundsInScreen = [cocoa_view_ convertRect:bounds toView:nil];
|
| + boundsInScreen = [enclosing_window convertRectToScreen:boundsInScreen];
|
| + const gfx::Point origin = FlipNSRectToRectScreen(boundsInScreen).origin();
|
| +
|
| + // Note: The GetViewBounds() API is a bit weird: The origin of the Rect is a
|
| + // point on the screen, in the screen's coordinate system. However, the size
|
| + // of the Rect is the rendering size, and not necessarily the size this view
|
| + // will occupy in the screen. The two may be different whenever this view is
|
| + // being scaled by any layer transforms in the ancestors in the hierarchy.
|
| + //
|
| + // TODO(miu): GetViewBounds() should be fixed because it's really returning
|
| + // two different things in one return value. Perhaps it should be deprecated
|
| + // in favor of GetRequestedRendererSize() and something new like
|
| + // GetPositionOnScreen()?
|
| + return gfx::Rect(origin, size);
|
| }
|
|
|
| void RenderWidgetHostViewMac::UpdateCursor(const WebCursor& cursor) {
|
|
|