| 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/common/test/ash_test.h" | 7 #include "ash/common/test/ash_test.h" |
| 8 #include "ash/mus/bridge/wm_window_mus.h" | 8 #include "ash/mus/bridge/wm_window_mus.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" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 std::unique_ptr<WindowOwner> AshTestImplMus::CreateTestWindow( | 58 std::unique_ptr<WindowOwner> AshTestImplMus::CreateTestWindow( |
| 59 const gfx::Rect& bounds_in_screen, | 59 const gfx::Rect& bounds_in_screen, |
| 60 ui::wm::WindowType type, | 60 ui::wm::WindowType type, |
| 61 int shell_window_id) { | 61 int shell_window_id) { |
| 62 WmWindowMus* window = | 62 WmWindowMus* window = |
| 63 WmWindowMus::Get(wm_test_base_->CreateTestWindow(bounds_in_screen, type)); | 63 WmWindowMus::Get(wm_test_base_->CreateTestWindow(bounds_in_screen, type)); |
| 64 window->SetShellWindowId(shell_window_id); | 64 window->SetShellWindowId(shell_window_id); |
| 65 return base::MakeUnique<WindowOwner>(window); | 65 return base::MakeUnique<WindowOwner>(window); |
| 66 } | 66 } |
| 67 | 67 |
| 68 std::unique_ptr<WindowOwner> AshTestImplMus::CreateToplevelTestWindow( |
| 69 const gfx::Rect& bounds_in_screen, |
| 70 int shell_window_id) { |
| 71 // For mus CreateTestWindow() creates top level windows (assuming |
| 72 // WINDOW_TYPE_NORMAL). |
| 73 return CreateTestWindow(bounds_in_screen, ui::wm::WINDOW_TYPE_NORMAL, |
| 74 shell_window_id); |
| 75 } |
| 76 |
| 68 display::Display AshTestImplMus::GetSecondaryDisplay() { | 77 display::Display AshTestImplMus::GetSecondaryDisplay() { |
| 69 return wm_test_base_->GetSecondaryDisplay(); | 78 return wm_test_base_->GetSecondaryDisplay(); |
| 70 } | 79 } |
| 71 | 80 |
| 72 bool AshTestImplMus::SetSecondaryDisplayPlacement( | 81 bool AshTestImplMus::SetSecondaryDisplayPlacement( |
| 73 display::DisplayPlacement::Position position, | 82 display::DisplayPlacement::Position position, |
| 74 int offset) { | 83 int offset) { |
| 75 NOTIMPLEMENTED(); | 84 NOTIMPLEMENTED(); |
| 76 return false; | 85 return false; |
| 77 } | 86 } |
| 78 | 87 |
| 88 void AshTestImplMus::ConfigureWidgetInitParamsForDisplay( |
| 89 WmWindow* window, |
| 90 views::Widget::InitParams* init_params) { |
| 91 init_params |
| 92 ->mus_properties[ui::mojom::WindowManager::kInitialDisplayId_Property] = |
| 93 mojo::ConvertTo<std::vector<uint8_t>>( |
| 94 WmWindowMus::GetMusWindow(window)->display_id()); |
| 95 } |
| 96 |
| 97 void AshTestImplMus::AddTransientChild(WmWindow* parent, WmWindow* window) { |
| 98 WmWindowMus::GetMusWindow(parent)->AddTransientWindow( |
| 99 WmWindowMus::GetMusWindow(window)); |
| 100 } |
| 101 |
| 79 } // namespace mus | 102 } // namespace mus |
| 80 | 103 |
| 81 // static | 104 // static |
| 82 std::unique_ptr<AshTestImpl> AshTestImpl::Create() { | 105 std::unique_ptr<AshTestImpl> AshTestImpl::Create() { |
| 83 return base::MakeUnique<mus::AshTestImplMus>(); | 106 return base::MakeUnique<mus::AshTestImplMus>(); |
| 84 } | 107 } |
| 85 | 108 |
| 109 // static |
| 110 bool AshTest::IsMash() { |
| 111 return true; |
| 112 } |
| 113 |
| 86 } // namespace ash | 114 } // namespace ash |
| OLD | NEW |