| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus/test/ash_test_impl_mus.h" | 5 #include "ash/mus/test/ash_test_impl_mus.h" |
| 6 | 6 |
| 7 #include "ash/test/ash_test.h" | 7 #include "ash/test/ash_test.h" |
| 8 #include "ash/wm_window.h" | 8 #include "ash/wm_window.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "services/ui/public/cpp/property_type_converters.h" | 10 #include "services/ui/public/cpp/property_type_converters.h" |
| 11 #include "services/ui/public/interfaces/window_manager.mojom.h" | 11 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 12 #include "ui/aura/window.h" |
| 12 #include "ui/wm/core/window_util.h" | 13 #include "ui/wm/core/window_util.h" |
| 13 | 14 |
| 14 namespace ash { | 15 namespace ash { |
| 15 namespace mus { | 16 namespace mus { |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 // WmTestBase is abstract as TestBody() is pure virtual (the various TEST | 19 // WmTestBase is abstract as TestBody() is pure virtual (the various TEST |
| 19 // macros have the implementation). In order to create WmTestBase we have to | 20 // macros have the implementation). In order to create WmTestBase we have to |
| 20 // subclass with an empty implementation of TestBody(). That's ok as the class | 21 // subclass with an empty implementation of TestBody(). That's ok as the class |
| 21 // isn't used as a normal test here. | 22 // isn't used as a normal test here. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 47 } | 48 } |
| 48 | 49 |
| 49 void AshTestImplMus::UpdateDisplay(const std::string& display_spec) { | 50 void AshTestImplMus::UpdateDisplay(const std::string& display_spec) { |
| 50 wm_test_base_->UpdateDisplay(display_spec); | 51 wm_test_base_->UpdateDisplay(display_spec); |
| 51 } | 52 } |
| 52 | 53 |
| 53 std::unique_ptr<WindowOwner> AshTestImplMus::CreateTestWindow( | 54 std::unique_ptr<WindowOwner> AshTestImplMus::CreateTestWindow( |
| 54 const gfx::Rect& bounds_in_screen, | 55 const gfx::Rect& bounds_in_screen, |
| 55 ui::wm::WindowType type, | 56 ui::wm::WindowType type, |
| 56 int shell_window_id) { | 57 int shell_window_id) { |
| 57 WmWindow* window = | 58 aura::Window* window = |
| 58 WmWindow::Get(wm_test_base_->CreateTestWindow(bounds_in_screen, type)); | 59 wm_test_base_->CreateTestWindow(bounds_in_screen, type); |
| 59 window->SetShellWindowId(shell_window_id); | 60 window->set_id(shell_window_id); |
| 60 return base::MakeUnique<WindowOwner>(window); | 61 return base::MakeUnique<WindowOwner>(WmWindow::Get(window)); |
| 61 } | 62 } |
| 62 | 63 |
| 63 std::unique_ptr<WindowOwner> AshTestImplMus::CreateToplevelTestWindow( | 64 std::unique_ptr<WindowOwner> AshTestImplMus::CreateToplevelTestWindow( |
| 64 const gfx::Rect& bounds_in_screen, | 65 const gfx::Rect& bounds_in_screen, |
| 65 int shell_window_id) { | 66 int shell_window_id) { |
| 66 // For mus CreateTestWindow() creates top level windows (assuming | 67 // For mus CreateTestWindow() creates top level windows (assuming |
| 67 // WINDOW_TYPE_NORMAL). | 68 // WINDOW_TYPE_NORMAL). |
| 68 return CreateTestWindow(bounds_in_screen, ui::wm::WINDOW_TYPE_NORMAL, | 69 return CreateTestWindow(bounds_in_screen, ui::wm::WINDOW_TYPE_NORMAL, |
| 69 shell_window_id); | 70 shell_window_id); |
| 70 } | 71 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 91 } | 92 } |
| 92 | 93 |
| 93 void AshTestImplMus::AddTransientChild(WmWindow* parent, WmWindow* window) { | 94 void AshTestImplMus::AddTransientChild(WmWindow* parent, WmWindow* window) { |
| 94 // TODO(sky): remove this as both classes can share same implementation now. | 95 // TODO(sky): remove this as both classes can share same implementation now. |
| 95 ::wm::AddTransientChild(WmWindow::GetAuraWindow(parent), | 96 ::wm::AddTransientChild(WmWindow::GetAuraWindow(parent), |
| 96 WmWindow::GetAuraWindow(window)); | 97 WmWindow::GetAuraWindow(window)); |
| 97 } | 98 } |
| 98 | 99 |
| 99 } // namespace mus | 100 } // namespace mus |
| 100 } // namespace ash | 101 } // namespace ash |
| OLD | NEW |