| 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/common/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/common/wm/workspace/workspace_layout_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/common/session/session_controller.h" | 10 #include "ash/common/session/session_controller.h" |
| 11 #include "ash/common/shelf/shelf_constants.h" | 11 #include "ash/common/shelf/shelf_constants.h" |
| 12 #include "ash/common/shelf/shelf_layout_manager.h" | 12 #include "ash/common/shelf/shelf_layout_manager.h" |
| 13 #include "ash/common/shelf/wm_shelf.h" | 13 #include "ash/common/shelf/wm_shelf.h" |
| 14 #include "ash/common/shell_observer.h" | 14 #include "ash/common/shell_observer.h" |
| 15 #include "ash/common/test/ash_test.h" | 15 #include "ash/common/test/ash_test.h" |
| 16 #include "ash/common/test/test_session_controller_client.h" | 16 #include "ash/common/test/test_session_controller_client.h" |
| 17 #include "ash/common/wm/fullscreen_window_finder.h" | 17 #include "ash/common/wm/fullscreen_window_finder.h" |
| 18 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h" | 18 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h" |
| 19 #include "ash/common/wm/window_state.h" | 19 #include "ash/common/wm/window_state.h" |
| 20 #include "ash/common/wm/wm_event.h" | 20 #include "ash/common/wm/wm_event.h" |
| 21 #include "ash/common/wm/wm_screen_util.h" | 21 #include "ash/common/wm/wm_screen_util.h" |
| 22 #include "ash/common/wm/workspace/workspace_window_resizer.h" | 22 #include "ash/common/wm/workspace/workspace_window_resizer.h" |
| 23 #include "ash/common/wm_shell.h" | 23 #include "ash/common/wm_shell.h" |
| 24 #include "ash/common/wm_window.h" | 24 #include "ash/common/wm_window.h" |
| 25 #include "ash/public/cpp/shell_window_ids.h" | 25 #include "ash/public/cpp/shell_window_ids.h" |
| 26 #include "ash/root_window_controller.h" | 26 #include "ash/root_window_controller.h" |
| 27 #include "ash/shell.h" | 27 #include "ash/shell.h" |
| 28 #include "ash/test/ash_test_base.h" | 28 #include "ash/test/ash_test_base.h" |
| 29 #include "ash/wm/window_state_aura.h" | 29 #include "ash/wm/window_state_aura.h" |
| 30 #include "ash/wm/window_util.h" |
| 30 #include "base/command_line.h" | 31 #include "base/command_line.h" |
| 31 #include "base/run_loop.h" | 32 #include "base/run_loop.h" |
| 32 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
| 33 #include "ui/base/ui_base_switches.h" | 34 #include "ui/base/ui_base_switches.h" |
| 34 #include "ui/base/ui_base_types.h" | 35 #include "ui/base/ui_base_types.h" |
| 35 #include "ui/compositor/layer_type.h" | 36 #include "ui/compositor/layer_type.h" |
| 36 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 37 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 37 #include "ui/display/display.h" | 38 #include "ui/display/display.h" |
| 38 #include "ui/display/screen.h" | 39 #include "ui/display/screen.h" |
| 39 #include "ui/gfx/geometry/insets.h" | 40 #include "ui/gfx/geometry/insets.h" |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 WmWindow::Get(always_on_top_window1_owner.get()); | 772 WmWindow::Get(always_on_top_window1_owner.get()); |
| 772 std::unique_ptr<aura::Window> always_on_top_window2_owner( | 773 std::unique_ptr<aura::Window> always_on_top_window2_owner( |
| 773 CreateTestWindowInShellWithBounds(bounds)); | 774 CreateTestWindowInShellWithBounds(bounds)); |
| 774 WmWindow* always_on_top_window2 = | 775 WmWindow* always_on_top_window2 = |
| 775 WmWindow::Get(always_on_top_window2_owner.get()); | 776 WmWindow::Get(always_on_top_window2_owner.get()); |
| 776 always_on_top_window1->SetAlwaysOnTop(true); | 777 always_on_top_window1->SetAlwaysOnTop(true); |
| 777 always_on_top_window2->SetAlwaysOnTop(true); | 778 always_on_top_window2->SetAlwaysOnTop(true); |
| 778 | 779 |
| 779 // Making a window pinned temporarily suspends always on top state. | 780 // Making a window pinned temporarily suspends always on top state. |
| 780 const bool trusted = false; | 781 const bool trusted = false; |
| 781 pinned_window->SetPinned(trusted); | 782 wm::PinWindow(pinned_window->aura_window(), trusted); |
| 782 EXPECT_FALSE(always_on_top_window1->IsAlwaysOnTop()); | 783 EXPECT_FALSE(always_on_top_window1->IsAlwaysOnTop()); |
| 783 EXPECT_FALSE(always_on_top_window2->IsAlwaysOnTop()); | 784 EXPECT_FALSE(always_on_top_window2->IsAlwaysOnTop()); |
| 784 | 785 |
| 785 // Adding a new always-on-top window also is affected by pinned mode. | 786 // Adding a new always-on-top window also is affected by pinned mode. |
| 786 std::unique_ptr<aura::Window> always_on_top_window3_owner( | 787 std::unique_ptr<aura::Window> always_on_top_window3_owner( |
| 787 CreateTestWindowInShellWithBounds(bounds)); | 788 CreateTestWindowInShellWithBounds(bounds)); |
| 788 WmWindow* always_on_top_window3 = | 789 WmWindow* always_on_top_window3 = |
| 789 WmWindow::Get(always_on_top_window3_owner.get()); | 790 WmWindow::Get(always_on_top_window3_owner.get()); |
| 790 always_on_top_window3->SetAlwaysOnTop(true); | 791 always_on_top_window3->SetAlwaysOnTop(true); |
| 791 EXPECT_FALSE(always_on_top_window3->IsAlwaysOnTop()); | 792 EXPECT_FALSE(always_on_top_window3->IsAlwaysOnTop()); |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 window->SetBounds(keyboard_bounds()); | 1279 window->SetBounds(keyboard_bounds()); |
| 1279 window->GetWindowState()->set_ignore_keyboard_bounds_change(true); | 1280 window->GetWindowState()->set_ignore_keyboard_bounds_change(true); |
| 1280 window->Activate(); | 1281 window->Activate(); |
| 1281 | 1282 |
| 1282 EXPECT_EQ(keyboard_bounds(), window->GetBounds()); | 1283 EXPECT_EQ(keyboard_bounds(), window->GetBounds()); |
| 1283 ShowKeyboard(); | 1284 ShowKeyboard(); |
| 1284 EXPECT_EQ(keyboard_bounds(), window->GetBounds()); | 1285 EXPECT_EQ(keyboard_bounds(), window->GetBounds()); |
| 1285 } | 1286 } |
| 1286 | 1287 |
| 1287 } // namespace ash | 1288 } // namespace ash |
| OLD | NEW |