summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-08 23:45:04 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-08 23:45:04 +0000
commit71b6d57d0fce39feaa91f007af1a3d731dab245c (patch)
tree2c44f452db5528e41f6ca93c3c81f58d3806ed84 /ui
parent0f787610de831dc12fba0c76fc15b6f141a350a6 (diff)
downloadchromium_src-71b6d57d0fce39feaa91f007af1a3d731dab245c.zip
chromium_src-71b6d57d0fce39feaa91f007af1a3d731dab245c.tar.gz
chromium_src-71b6d57d0fce39feaa91f007af1a3d731dab245c.tar.bz2
Fix DesktopHostWin::SetSize to set the size of aura desktop (client size)
DesktopHostWin::SetSize sets the window size, but ::GetSize return client area size which is smaller. Sets the correct window origin when setting the size instead of (0,0). BUG=none TEST=SetBounds/DragWindow tests now pass on windows. Review URL: http://codereview.chromium.org/8478008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/desktop_host_win.cc18
-rw-r--r--ui/aura_shell/default_container_layout_manager_unittest.cc4
2 files changed, 16 insertions, 6 deletions
diff --git a/ui/aura/desktop_host_win.cc b/ui/aura/desktop_host_win.cc
index 068be1a..8928ef2 100644
--- a/ui/aura/desktop_host_win.cc
+++ b/ui/aura/desktop_host_win.cc
@@ -182,13 +182,27 @@ gfx::Size DesktopHostWin::GetSize() const {
}
void DesktopHostWin::SetSize(const gfx::Size& size) {
+ if (fullscreen_) {
+ saved_window_rect_.right = saved_window_rect_.left + size.width();
+ saved_window_rect_.bottom = saved_window_rect_.top + size.height();
+ return;
+ }
+ RECT window_rect;
+ window_rect.left = 0;
+ window_rect.top = 0;
+ window_rect.right = size.width();
+ window_rect.bottom = size.height();
+ AdjustWindowRectEx(&window_rect,
+ GetWindowLong(hwnd(), GWL_STYLE),
+ FALSE,
+ GetWindowLong(hwnd(), GWL_EXSTYLE));
SetWindowPos(
hwnd(),
NULL,
0,
0,
- size.width(),
- size.height(),
+ window_rect.right - window_rect.left,
+ window_rect.bottom - window_rect.top,
SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOREPOSITION);
}
diff --git a/ui/aura_shell/default_container_layout_manager_unittest.cc b/ui/aura_shell/default_container_layout_manager_unittest.cc
index 534a0d9..2e6837c 100644
--- a/ui/aura_shell/default_container_layout_manager_unittest.cc
+++ b/ui/aura_shell/default_container_layout_manager_unittest.cc
@@ -105,7 +105,6 @@ ui::WindowShowState GetShowState(aura::Window* window) {
} // namespace
-#if !defined(OS_WIN)
TEST_F(DefaultContainerLayoutManagerTest, SetBounds) {
// Layout Manager moves the window to (0,0) to fit to draggable area.
scoped_ptr<aura::Window> child(
@@ -127,9 +126,7 @@ TEST_F(DefaultContainerLayoutManagerTest, SetBounds) {
child->SetBounds(gfx::Rect(0, -500, 900, 500));
EXPECT_EQ("0,0 500x400", child->bounds().ToString());
}
-#endif
-#if !defined(OS_WIN)
TEST_F(DefaultContainerLayoutManagerTest, DragWindow) {
scoped_ptr<aura::Window> child(
CreateTestWindow(gfx::Rect(0, -1000, 50, 50), container()));
@@ -145,7 +142,6 @@ TEST_F(DefaultContainerLayoutManagerTest, DragWindow) {
default_container_layout_manager()->EndMove(child.get(), NULL);
EXPECT_EQ(original_bounds.ToString(), child->GetTargetBounds().ToString());
}
-#endif
TEST_F(DefaultContainerLayoutManagerTest, Popup) {
scoped_ptr<aura::Window> popup(