| 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/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/display/extended_mouse_warp_controller.h" | 10 #include "ash/display/extended_mouse_warp_controller.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 ui::mojom::kResizeBehaviorCanResize | | 281 ui::mojom::kResizeBehaviorCanResize | |
| 282 ui::mojom::kResizeBehaviorCanMaximize | | 282 ui::mojom::kResizeBehaviorCanMaximize | |
| 283 ui::mojom::kResizeBehaviorCanMinimize)); | 283 ui::mojom::kResizeBehaviorCanMinimize)); |
| 284 | 284 |
| 285 const ui::mojom::WindowType mus_window_type = | 285 const ui::mojom::WindowType mus_window_type = |
| 286 MusWindowTypeFromWmWindowType(type); | 286 MusWindowTypeFromWmWindowType(type); |
| 287 mus::WindowManager* window_manager = | 287 mus::WindowManager* window_manager = |
| 288 ash_test_helper_->window_manager_app()->window_manager(); | 288 ash_test_helper_->window_manager_app()->window_manager(); |
| 289 aura::Window* window = mus::CreateAndParentTopLevelWindow( | 289 aura::Window* window = mus::CreateAndParentTopLevelWindow( |
| 290 window_manager, mus_window_type, &properties); | 290 window_manager, mus_window_type, &properties); |
| 291 window->set_id(shell_window_id); |
| 291 window->Show(); | 292 window->Show(); |
| 292 return base::WrapUnique<aura::Window>(window); | 293 return base::WrapUnique<aura::Window>(window); |
| 293 } | 294 } |
| 294 | 295 |
| 296 std::unique_ptr<aura::Window> AshTestBase::CreateToplevelTestWindow( |
| 297 const gfx::Rect& bounds_in_screen, |
| 298 int shell_window_id) { |
| 299 if (AshTestHelper::config() == Config::MASH) { |
| 300 return CreateTestWindow(bounds_in_screen, ui::wm::WINDOW_TYPE_NORMAL, |
| 301 shell_window_id); |
| 302 } |
| 303 |
| 304 aura::test::TestWindowDelegate* delegate = |
| 305 aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(); |
| 306 return base::WrapUnique<aura::Window>( |
| 307 CreateTestWindowInShellWithDelegateAndType( |
| 308 delegate, ui::wm::WINDOW_TYPE_NORMAL, shell_window_id, |
| 309 bounds_in_screen)); |
| 310 } |
| 311 |
| 295 aura::Window* AshTestBase::CreateTestWindowInShellWithId(int id) { | 312 aura::Window* AshTestBase::CreateTestWindowInShellWithId(int id) { |
| 296 return CreateTestWindowInShellWithDelegate(NULL, id, gfx::Rect()); | 313 return CreateTestWindowInShellWithDelegate(NULL, id, gfx::Rect()); |
| 297 } | 314 } |
| 298 | 315 |
| 299 aura::Window* AshTestBase::CreateTestWindowInShellWithBounds( | 316 aura::Window* AshTestBase::CreateTestWindowInShellWithBounds( |
| 300 const gfx::Rect& bounds) { | 317 const gfx::Rect& bounds) { |
| 301 return CreateTestWindowInShellWithDelegate(NULL, 0, bounds); | 318 return CreateTestWindowInShellWithDelegate(NULL, 0, bounds); |
| 302 } | 319 } |
| 303 | 320 |
| 304 aura::Window* AshTestBase::CreateTestWindowInShell(SkColor color, | 321 aura::Window* AshTestBase::CreateTestWindowInShell(SkColor color, |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 return display::Screen::GetScreen()->GetDisplayNearestWindow( | 495 return display::Screen::GetScreen()->GetDisplayNearestWindow( |
| 479 Shell::GetPrimaryRootWindow()); | 496 Shell::GetPrimaryRootWindow()); |
| 480 } | 497 } |
| 481 | 498 |
| 482 display::Display AshTestBase::GetSecondaryDisplay() { | 499 display::Display AshTestBase::GetSecondaryDisplay() { |
| 483 return ash_test_helper_->GetSecondaryDisplay(); | 500 return ash_test_helper_->GetSecondaryDisplay(); |
| 484 } | 501 } |
| 485 | 502 |
| 486 } // namespace test | 503 } // namespace test |
| 487 } // namespace ash | 504 } // namespace ash |
| OLD | NEW |