Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 820 TRACE_EVENT1("ui", "RootWindow::OnHostResized", | 820 TRACE_EVENT1("ui", "RootWindow::OnHostResized", |
| 821 "size", size.ToString()); | 821 "size", size.ToString()); |
| 822 | 822 |
| 823 DispatchDetails details = DispatchHeldEvents(); | 823 DispatchDetails details = DispatchHeldEvents(); |
| 824 if (details.dispatcher_destroyed) | 824 if (details.dispatcher_destroyed) |
| 825 return; | 825 return; |
| 826 // The compositor should have the same size as the native root window host. | 826 // The compositor should have the same size as the native root window host. |
| 827 // Get the latest scale from display because it might have been changed. | 827 // Get the latest scale from display because it might have been changed. |
| 828 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), size); | 828 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), size); |
| 829 | 829 |
| 830 gfx::Size window_size = host_->GetBounds().size(); | |
| 831 // If the window is minimized, then its size should be 0x0. | |
| 832 if (size.IsEmpty()) | |
| 833 window_size = gfx::Size(); | |
| 830 // The layer, and the observers should be notified of the | 834 // The layer, and the observers should be notified of the |
| 831 // transformed size of the root window. | 835 // transformed size of the root window. |
| 832 UpdateRootWindowSize(size); | 836 UpdateRootWindowSize(window_size); |
|
Ben Goodger (Google)
2013/11/20 21:50:44
What does GetBounds() return if the window is mini
| |
| 833 FOR_EACH_OBSERVER(RootWindowObserver, observers_, | 837 FOR_EACH_OBSERVER(RootWindowObserver, observers_, |
| 834 OnRootWindowHostResized(this)); | 838 OnRootWindowHostResized(this)); |
| 835 } | 839 } |
| 836 | 840 |
| 837 float RootWindow::GetDeviceScaleFactor() { | 841 float RootWindow::GetDeviceScaleFactor() { |
| 838 return compositor()->device_scale_factor(); | 842 return compositor()->device_scale_factor(); |
| 839 } | 843 } |
| 840 | 844 |
| 841 RootWindow* RootWindow::AsRootWindow() { | 845 RootWindow* RootWindow::AsRootWindow() { |
| 842 return this; | 846 return this; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1125 } | 1129 } |
| 1126 | 1130 |
| 1127 gfx::Transform RootWindow::GetInverseRootTransform() const { | 1131 gfx::Transform RootWindow::GetInverseRootTransform() const { |
| 1128 float scale = ui::GetDeviceScaleFactor(window()->layer()); | 1132 float scale = ui::GetDeviceScaleFactor(window()->layer()); |
| 1129 gfx::Transform transform; | 1133 gfx::Transform transform; |
| 1130 transform.Scale(1.0f / scale, 1.0f / scale); | 1134 transform.Scale(1.0f / scale, 1.0f / scale); |
| 1131 return transformer_->GetInverseTransform() * transform; | 1135 return transformer_->GetInverseTransform() * transform; |
| 1132 } | 1136 } |
| 1133 | 1137 |
| 1134 } // namespace aura | 1138 } // namespace aura |
| OLD | NEW |