Chromium Code Reviews| Index: ui/aura/window.cc |
| diff --git a/ui/aura/window.cc b/ui/aura/window.cc |
| index df66b704f488409810c4598b5c33c1db1f34abf5..8dd758bcad107a2e28f0290a118053f804df1497 100644 |
| --- a/ui/aura/window.cc |
| +++ b/ui/aura/window.cc |
| @@ -383,11 +383,15 @@ gfx::Rect Window::GetBoundsInRootWindow() const { |
| // TODO(beng): There may be a better way to handle this, and the existing code |
| // is likely wrong anyway in a multi-display world, but this will |
| // do for now. |
| - if (!GetRootWindow()) |
| + const Window* root = GetRootWindow(); |
| + if (!root) |
| return bounds(); |
| - gfx::Point origin = bounds().origin(); |
| - ConvertPointToTarget(parent_, GetRootWindow(), &origin); |
| - return gfx::Rect(origin, bounds().size()); |
| + gfx::Transform transform; |
| + if (!layer()->GetTargetTransformRelativeTo(root->layer(), &transform)) |
| + return gfx::Rect(); |
| + gfx::RectF rect(bounds().size()); |
| + transform.TransformRect(&rect); |
|
oshima
2014/02/20 19:39:35
While I understand the motivation and the current
sadrul
2014/02/20 19:59:59
If there are such cases, perhaps we should find an
oshima
2014/02/20 20:18:51
I think the reason is that such scenario is rare (
sadrul
2014/02/20 21:53:48
Indeed. The motivation from this patch is from her
|
| + return gfx::ToEnclosingRect(rect); |
| } |
| gfx::Rect Window::GetBoundsInScreen() const { |