| 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 "ash/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/display/display_layout.h" | 7 #include "ash/display/display_layout.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 bounds.Intersect(root_window_bounds); | 340 bounds.Intersect(root_window_bounds); |
| 341 | 341 |
| 342 // 30% of the window edge must be visible. | 342 // 30% of the window edge must be visible. |
| 343 EXPECT_GT(bounds.width(), out_window->bounds().width() * 0.29); | 343 EXPECT_GT(bounds.width(), out_window->bounds().width() * 0.29); |
| 344 EXPECT_GT(bounds.height(), out_window->bounds().height() * 0.29); | 344 EXPECT_GT(bounds.height(), out_window->bounds().height() * 0.29); |
| 345 | 345 |
| 346 aura::Window* parent = out_window->parent(); | 346 aura::Window* parent = out_window->parent(); |
| 347 parent->RemoveChild(out_window.get()); | 347 parent->RemoveChild(out_window.get()); |
| 348 out_window->SetBounds(gfx::Rect(-200, -200, 200, 200)); | 348 out_window->SetBounds(gfx::Rect(-200, -200, 200, 200)); |
| 349 // UserHasChangedWindowPositionOrSize flag shouldn't turn off this behavior. | 349 // UserHasChangedWindowPositionOrSize flag shouldn't turn off this behavior. |
| 350 wm::GetWindowState(window.get())->set_bounds_changed_by_user(true); | 350 wm::GetWindowState(window.get())->SetBoundsChangedByUser(true); |
| 351 parent->AddChild(out_window.get()); | 351 parent->AddChild(out_window.get()); |
| 352 EXPECT_GT(bounds.width(), out_window->bounds().width() * 0.29); | 352 EXPECT_GT(bounds.width(), out_window->bounds().width() * 0.29); |
| 353 EXPECT_GT(bounds.height(), out_window->bounds().height() * 0.29); | 353 EXPECT_GT(bounds.height(), out_window->bounds().height() * 0.29); |
| 354 | 354 |
| 355 // Make sure we always make more than 1/3 of the window edge visible even | 355 // Make sure we always make more than 1/3 of the window edge visible even |
| 356 // if the initial bounds intersects with display. | 356 // if the initial bounds intersects with display. |
| 357 window_bounds.SetRect(-150, -150, 200, 200); | 357 window_bounds.SetRect(-150, -150, 200, 200); |
| 358 bounds = window_bounds; | 358 bounds = window_bounds; |
| 359 bounds.Intersect(root_window_bounds); | 359 bounds.Intersect(root_window_bounds); |
| 360 | 360 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 window->bounds().ToString()); | 401 window->bounds().ToString()); |
| 402 | 402 |
| 403 // Directly setting the bounds triggers a slightly different code path. Verify | 403 // Directly setting the bounds triggers a slightly different code path. Verify |
| 404 // that too. | 404 // that too. |
| 405 window->SetBounds(window_bounds); | 405 window->SetBounds(window_bounds); |
| 406 EXPECT_EQ(gfx::Rect(gfx::Point(100, 101), work_area).ToString(), | 406 EXPECT_EQ(gfx::Rect(gfx::Point(100, 101), work_area).ToString(), |
| 407 window->bounds().ToString()); | 407 window->bounds().ToString()); |
| 408 } | 408 } |
| 409 | 409 |
| 410 } // namespace ash | 410 } // namespace ash |
| OLD | NEW |