| 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/wm_test_base.h" | 5 #include "ash/mus/test/wm_test_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/mus/test/wm_test_helper.h" | 10 #include "ash/mus/test/wm_test_helper.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 const ui::mojom::WindowType mus_window_type = | 121 const ui::mojom::WindowType mus_window_type = |
| 122 MusWindowTypeFromWmWindowType(window_type); | 122 MusWindowTypeFromWmWindowType(window_type); |
| 123 WindowManager* window_manager = | 123 WindowManager* window_manager = |
| 124 test_helper_->window_manager_app()->window_manager(); | 124 test_helper_->window_manager_app()->window_manager(); |
| 125 aura::Window* window = CreateAndParentTopLevelWindow( | 125 aura::Window* window = CreateAndParentTopLevelWindow( |
| 126 window_manager, mus_window_type, &properties); | 126 window_manager, mus_window_type, &properties); |
| 127 window->Show(); | 127 window->Show(); |
| 128 return window; | 128 return window; |
| 129 } | 129 } |
| 130 | 130 |
| 131 aura::Window* WmTestBase::CreateFullscreenTestWindow(int64_t display_id) { | |
| 132 std::map<std::string, std::vector<uint8_t>> properties; | |
| 133 properties[ui::mojom::WindowManager::kShowState_Property] = | |
| 134 mojo::ConvertTo<std::vector<uint8_t>>( | |
| 135 static_cast<aura::PropertyConverter::PrimitiveType>( | |
| 136 ui::mojom::ShowState::FULLSCREEN)); | |
| 137 if (display_id != display::kInvalidDisplayId) { | |
| 138 properties[ui::mojom::WindowManager::kDisplayId_InitProperty] = | |
| 139 mojo::ConvertTo<std::vector<uint8_t>>(display_id); | |
| 140 } | |
| 141 WindowManager* window_manager = | |
| 142 test_helper_->window_manager_app()->window_manager(); | |
| 143 aura::Window* window = CreateAndParentTopLevelWindow( | |
| 144 window_manager, ui::mojom::WindowType::WINDOW, &properties); | |
| 145 window->Show(); | |
| 146 return window; | |
| 147 } | |
| 148 | |
| 149 aura::Window* WmTestBase::CreateChildTestWindow(aura::Window* parent, | 131 aura::Window* WmTestBase::CreateChildTestWindow(aura::Window* parent, |
| 150 const gfx::Rect& bounds) { | 132 const gfx::Rect& bounds) { |
| 151 std::map<std::string, std::vector<uint8_t>> properties; | 133 std::map<std::string, std::vector<uint8_t>> properties; |
| 152 aura::Window* window = new aura::Window(nullptr); | 134 aura::Window* window = new aura::Window(nullptr); |
| 153 window->Init(ui::LAYER_TEXTURED); | 135 window->Init(ui::LAYER_TEXTURED); |
| 154 window->SetBounds(bounds); | 136 window->SetBounds(bounds); |
| 155 window->Show(); | 137 window->Show(); |
| 156 parent->AddChild(window); | 138 parent->AddChild(window); |
| 157 return window; | 139 return window; |
| 158 } | 140 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 info->can_lock_screen = true; | 179 info->can_lock_screen = true; |
| 198 info->should_lock_screen_automatically = false; | 180 info->should_lock_screen_automatically = false; |
| 199 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; | 181 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; |
| 200 info->state = session_manager::SessionState::ACTIVE; | 182 info->state = session_manager::SessionState::ACTIVE; |
| 201 session_controller->SetSessionInfo(std::move(info)); | 183 session_controller->SetSessionInfo(std::move(info)); |
| 202 } | 184 } |
| 203 | 185 |
| 204 | 186 |
| 205 } // namespace mus | 187 } // namespace mus |
| 206 } // namespace ash | 188 } // namespace ash |
| OLD | NEW |