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/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
| 8 #include <utility> |
8 | 9 |
9 #include "ash/display/display_layout.h" | 10 #include "ash/display/display_layout.h" |
10 #include "ash/display/display_manager.h" | 11 #include "ash/display/display_manager.h" |
11 #include "ash/root_window_controller.h" | 12 #include "ash/root_window_controller.h" |
12 #include "ash/screen_util.h" | 13 #include "ash/screen_util.h" |
13 #include "ash/session/session_state_delegate.h" | 14 #include "ash/session/session_state_delegate.h" |
14 #include "ash/shelf/shelf_layout_manager.h" | 15 #include "ash/shelf/shelf_layout_manager.h" |
15 #include "ash/shell.h" | 16 #include "ash/shell.h" |
16 #include "ash/shell_observer.h" | 17 #include "ash/shell_observer.h" |
17 #include "ash/shell_window_ids.h" | 18 #include "ash/shell_window_ids.h" |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 return window; | 828 return window; |
828 } | 829 } |
829 | 830 |
830 // Turn the top window back drop on / off. | 831 // Turn the top window back drop on / off. |
831 void ShowTopWindowBackdrop(bool show) { | 832 void ShowTopWindowBackdrop(bool show) { |
832 scoped_ptr<ash::WorkspaceLayoutManagerDelegate> backdrop; | 833 scoped_ptr<ash::WorkspaceLayoutManagerDelegate> backdrop; |
833 if (show) { | 834 if (show) { |
834 backdrop.reset(new ash::WorkspaceBackdropDelegate(default_container_)); | 835 backdrop.reset(new ash::WorkspaceBackdropDelegate(default_container_)); |
835 } | 836 } |
836 (static_cast<WorkspaceLayoutManager*>(default_container_->layout_manager())) | 837 (static_cast<WorkspaceLayoutManager*>(default_container_->layout_manager())) |
837 ->SetMaximizeBackdropDelegate(backdrop.Pass()); | 838 ->SetMaximizeBackdropDelegate(std::move(backdrop)); |
838 // Closing and / or opening can be a delayed operation. | 839 // Closing and / or opening can be a delayed operation. |
839 base::MessageLoop::current()->RunUntilIdle(); | 840 base::MessageLoop::current()->RunUntilIdle(); |
840 } | 841 } |
841 | 842 |
842 // Return the default container. | 843 // Return the default container. |
843 aura::Window* default_container() { return default_container_; } | 844 aura::Window* default_container() { return default_container_; } |
844 | 845 |
845 // Return the order of windows (top most first) as they are in the default | 846 // Return the order of windows (top most first) as they are in the default |
846 // container. If the window is visible it will be a big letter, otherwise a | 847 // container. If the window is visible it will be a big letter, otherwise a |
847 // small one. The backdrop will be an X and unknown windows will be shown as | 848 // small one. The backdrop will be an X and unknown windows will be shown as |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 EXPECT_EQ(gfx::Rect(50, | 1130 EXPECT_EQ(gfx::Rect(50, |
1130 keyboard_bounds.y() - keyboard_bounds.height()/2, | 1131 keyboard_bounds.y() - keyboard_bounds.height()/2, |
1131 occluded_window_bounds.width(), | 1132 occluded_window_bounds.width(), |
1132 occluded_window_bounds.height()).ToString(), | 1133 occluded_window_bounds.height()).ToString(), |
1133 window->bounds().ToString()); | 1134 window->bounds().ToString()); |
1134 HideKeyboard(); | 1135 HideKeyboard(); |
1135 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); | 1136 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); |
1136 } | 1137 } |
1137 | 1138 |
1138 } // namespace ash | 1139 } // namespace ash |
OLD | NEW |