| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/panels/panel_window_resizer.h" | 5 #include "ash/wm/panels/panel_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 501 |
| 502 // Tests that panels can have transient children of different types. | 502 // Tests that panels can have transient children of different types. |
| 503 // The transient children should be reparented in sync with the panel. | 503 // The transient children should be reparented in sync with the panel. |
| 504 TEST_P(PanelWindowResizerTransientTest, PanelWithTransientChild) { | 504 TEST_P(PanelWindowResizerTransientTest, PanelWithTransientChild) { |
| 505 if (!SupportsHostWindowResize()) | 505 if (!SupportsHostWindowResize()) |
| 506 return; | 506 return; |
| 507 | 507 |
| 508 scoped_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); | 508 scoped_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); |
| 509 scoped_ptr<aura::Window> child(CreateTestWindowInShellWithDelegateAndType( | 509 scoped_ptr<aura::Window> child(CreateTestWindowInShellWithDelegateAndType( |
| 510 NULL, transient_window_type_, 0, gfx::Rect(20, 20, 150, 40))); | 510 NULL, transient_window_type_, 0, gfx::Rect(20, 20, 150, 40))); |
| 511 views::corewm::AddTransientChild(window.get(), child.get()); | 511 ::wm::AddTransientChild(window.get(), child.get()); |
| 512 if (window->parent() != child->parent()) | 512 if (window->parent() != child->parent()) |
| 513 window->parent()->AddChild(child.get()); | 513 window->parent()->AddChild(child.get()); |
| 514 EXPECT_EQ(window.get(), views::corewm::GetTransientParent(child.get())); | 514 EXPECT_EQ(window.get(), ::wm::GetTransientParent(child.get())); |
| 515 | 515 |
| 516 // Drag the child to the shelf. Its new position should not be overridden. | 516 // Drag the child to the shelf. Its new position should not be overridden. |
| 517 const gfx::Rect attached_bounds(window->GetBoundsInScreen()); | 517 const gfx::Rect attached_bounds(window->GetBoundsInScreen()); |
| 518 const int dy = window->GetBoundsInScreen().bottom() - | 518 const int dy = window->GetBoundsInScreen().bottom() - |
| 519 child->GetBoundsInScreen().bottom(); | 519 child->GetBoundsInScreen().bottom(); |
| 520 DragStart(child.get()); | 520 DragStart(child.get()); |
| 521 DragMove(50, dy); | 521 DragMove(50, dy); |
| 522 // While moving the transient child window should be in the panel container. | 522 // While moving the transient child window should be in the panel container. |
| 523 EXPECT_EQ(internal::kShellWindowId_PanelContainer, child->parent()->id()); | 523 EXPECT_EQ(internal::kShellWindowId_PanelContainer, child->parent()->id()); |
| 524 DragEnd(); | 524 DragEnd(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, | 564 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, |
| 565 testing::Bool()); | 565 testing::Bool()); |
| 566 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, | 566 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, |
| 567 PanelWindowResizerTransientTest, | 567 PanelWindowResizerTransientTest, |
| 568 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 568 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 569 ui::wm::WINDOW_TYPE_PANEL, | 569 ui::wm::WINDOW_TYPE_PANEL, |
| 570 ui::wm::WINDOW_TYPE_POPUP)); | 570 ui::wm::WINDOW_TYPE_POPUP)); |
| 571 | 571 |
| 572 } // namespace internal | 572 } // namespace internal |
| 573 } // namespace ash | 573 } // namespace ash |
| OLD | NEW |