| 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" |
| 11 #include "ash/display/mouse_cursor_event_filter.h" | 11 #include "ash/display/mouse_cursor_event_filter.h" |
| 12 #include "ash/display/unified_mouse_warp_controller.h" | 12 #include "ash/display/unified_mouse_warp_controller.h" |
| 13 #include "ash/display/window_tree_host_manager.h" | 13 #include "ash/display/window_tree_host_manager.h" |
| 14 #include "ash/ime/input_method_event_handler.h" | 14 #include "ash/ime/input_method_event_handler.h" |
| 15 #include "ash/public/cpp/config.h" | 15 #include "ash/public/cpp/config.h" |
| 16 #include "ash/public/cpp/window_properties.h" |
| 16 #include "ash/root_window_controller.h" | 17 #include "ash/root_window_controller.h" |
| 17 #include "ash/session/session_controller.h" | 18 #include "ash/session/session_controller.h" |
| 18 #include "ash/shell.h" | 19 #include "ash/shell.h" |
| 19 #include "ash/shell/toplevel_window.h" | 20 #include "ash/shell/toplevel_window.h" |
| 20 #include "ash/shell_port.h" | 21 #include "ash/shell_port.h" |
| 21 #include "ash/test/ash_test_environment.h" | 22 #include "ash/test/ash_test_environment.h" |
| 22 #include "ash/test/ash_test_helper.h" | 23 #include "ash/test/ash_test_helper.h" |
| 23 #include "ash/test/test_session_controller_client.h" | 24 #include "ash/test/test_session_controller_client.h" |
| 24 #include "ash/test/test_shell_delegate.h" | 25 #include "ash/test/test_shell_delegate.h" |
| 25 #include "ash/test/test_system_tray_delegate.h" | 26 #include "ash/test/test_system_tray_delegate.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 ->aura_window(); | 278 ->aura_window(); |
| 278 gfx::Point origin = bounds.origin(); | 279 gfx::Point origin = bounds.origin(); |
| 279 ::wm::ConvertPointFromScreen(root, &origin); | 280 ::wm::ConvertPointFromScreen(root, &origin); |
| 280 window->SetBounds(gfx::Rect(origin, bounds.size())); | 281 window->SetBounds(gfx::Rect(origin, bounds.size())); |
| 281 aura::client::ParentWindowWithContext(window, root, bounds); | 282 aura::client::ParentWindowWithContext(window, root, bounds); |
| 282 } | 283 } |
| 283 window->SetProperty(aura::client::kResizeBehaviorKey, | 284 window->SetProperty(aura::client::kResizeBehaviorKey, |
| 284 ui::mojom::kResizeBehaviorCanMaximize | | 285 ui::mojom::kResizeBehaviorCanMaximize | |
| 285 ui::mojom::kResizeBehaviorCanMinimize | | 286 ui::mojom::kResizeBehaviorCanMinimize | |
| 286 ui::mojom::kResizeBehaviorCanResize); | 287 ui::mojom::kResizeBehaviorCanResize); |
| 288 // Setting the item type triggers ShelfWindowWatcher to create a shelf item. |
| 289 if (type == ui::wm::WINDOW_TYPE_PANEL) |
| 290 window->SetProperty<int>(kShelfItemTypeKey, TYPE_APP_PANEL); |
| 287 | 291 |
| 288 return window; | 292 return window; |
| 289 } | 293 } |
| 290 | 294 |
| 291 void AshTestBase::ParentWindowInPrimaryRootWindow(aura::Window* window) { | 295 void AshTestBase::ParentWindowInPrimaryRootWindow(aura::Window* window) { |
| 292 aura::client::ParentWindowWithContext(window, Shell::GetPrimaryRootWindow(), | 296 aura::client::ParentWindowWithContext(window, Shell::GetPrimaryRootWindow(), |
| 293 gfx::Rect()); | 297 gfx::Rect()); |
| 294 } | 298 } |
| 295 | 299 |
| 296 void AshTestBase::RunAllPendingInMessageLoop() { | 300 void AshTestBase::RunAllPendingInMessageLoop() { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 Shell::Get()->window_tree_host_manager()->SetPrimaryDisplayId( | 400 Shell::Get()->window_tree_host_manager()->SetPrimaryDisplayId( |
| 397 display_manager()->GetSecondaryDisplay().id()); | 401 display_manager()->GetSecondaryDisplay().id()); |
| 398 } | 402 } |
| 399 | 403 |
| 400 display::Display AshTestBase::GetSecondaryDisplay() { | 404 display::Display AshTestBase::GetSecondaryDisplay() { |
| 401 return ash_test_helper_->GetSecondaryDisplay(); | 405 return ash_test_helper_->GetSecondaryDisplay(); |
| 402 } | 406 } |
| 403 | 407 |
| 404 } // namespace test | 408 } // namespace test |
| 405 } // namespace ash | 409 } // namespace ash |
| OLD | NEW |