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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "ash/touch/touch_hud_debug.h" | 29 #include "ash/touch/touch_hud_debug.h" |
30 #include "ash/touch/touch_hud_projection.h" | 30 #include "ash/touch/touch_hud_projection.h" |
31 #include "ash/touch/touch_observer_hud.h" | 31 #include "ash/touch/touch_observer_hud.h" |
32 #include "ash/wm/always_on_top_controller.h" | 32 #include "ash/wm/always_on_top_controller.h" |
33 #include "ash/wm/base_layout_manager.h" | 33 #include "ash/wm/base_layout_manager.h" |
34 #include "ash/wm/dock/docked_window_layout_manager.h" | 34 #include "ash/wm/dock/docked_window_layout_manager.h" |
35 #include "ash/wm/panels/panel_layout_manager.h" | 35 #include "ash/wm/panels/panel_layout_manager.h" |
36 #include "ash/wm/panels/panel_window_event_handler.h" | 36 #include "ash/wm/panels/panel_window_event_handler.h" |
37 #include "ash/wm/root_window_layout_manager.h" | 37 #include "ash/wm/root_window_layout_manager.h" |
38 #include "ash/wm/screen_dimmer.h" | 38 #include "ash/wm/screen_dimmer.h" |
39 #include "ash/wm/solo_window_tracker.h" | |
40 #include "ash/wm/stacking_controller.h" | 39 #include "ash/wm/stacking_controller.h" |
41 #include "ash/wm/status_area_layout_manager.h" | 40 #include "ash/wm/status_area_layout_manager.h" |
42 #include "ash/wm/system_background_controller.h" | 41 #include "ash/wm/system_background_controller.h" |
43 #include "ash/wm/system_modal_container_layout_manager.h" | 42 #include "ash/wm/system_modal_container_layout_manager.h" |
44 #include "ash/wm/toplevel_window_event_handler.h" | 43 #include "ash/wm/toplevel_window_event_handler.h" |
45 #include "ash/wm/window_properties.h" | 44 #include "ash/wm/window_properties.h" |
46 #include "ash/wm/window_state.h" | 45 #include "ash/wm/window_state.h" |
47 #include "ash/wm/window_util.h" | 46 #include "ash/wm/window_util.h" |
48 #include "ash/wm/workspace_controller.h" | 47 #include "ash/wm/workspace_controller.h" |
49 #include "base/command_line.h" | 48 #include "base/command_line.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 // before move it to |kDesktopController|. | 444 // before move it to |kDesktopController|. |
446 DCHECK_EQ(controller->widget(), widget); | 445 DCHECK_EQ(controller->widget(), widget); |
447 // Release the old controller and close its background widget. | 446 // Release the old controller and close its background widget. |
448 SetWallpaperController(controller); | 447 SetWallpaperController(controller); |
449 } | 448 } |
450 } | 449 } |
451 | 450 |
452 void RootWindowController::CloseChildWindows() { | 451 void RootWindowController::CloseChildWindows() { |
453 mouse_event_target_.reset(); | 452 mouse_event_target_.reset(); |
454 | 453 |
455 // |solo_window_tracker_| must be shut down before windows are destroyed. | |
456 if (solo_window_tracker_) { | |
457 if (docked_layout_manager_) | |
458 docked_layout_manager_->RemoveObserver(solo_window_tracker_.get()); | |
459 solo_window_tracker_.reset(); | |
460 } | |
461 | |
462 // Deactivate keyboard container before closing child windows and shutting | 454 // Deactivate keyboard container before closing child windows and shutting |
463 // down associated layout managers. | 455 // down associated layout managers. |
464 DeactivateKeyboard(Shell::GetInstance()->keyboard_controller()); | 456 DeactivateKeyboard(Shell::GetInstance()->keyboard_controller()); |
465 | 457 |
466 // panel_layout_manager_ needs to be shut down before windows are destroyed. | 458 // panel_layout_manager_ needs to be shut down before windows are destroyed. |
467 if (panel_layout_manager_) { | 459 if (panel_layout_manager_) { |
468 panel_layout_manager_->Shutdown(); | 460 panel_layout_manager_->Shutdown(); |
469 panel_layout_manager_ = NULL; | 461 panel_layout_manager_ = NULL; |
470 } | 462 } |
471 // docked_layout_manager_ needs to be shut down before windows are destroyed. | 463 // docked_layout_manager_ needs to be shut down before windows are destroyed. |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 root_window_layout()->OnWindowResized(); | 679 root_window_layout()->OnWindowResized(); |
688 shell->desktop_background_controller()->OnRootWindowAdded(root_window()); | 680 shell->desktop_background_controller()->OnRootWindowAdded(root_window()); |
689 shell->high_contrast_controller()->OnRootWindowAdded( | 681 shell->high_contrast_controller()->OnRootWindowAdded( |
690 root_window_->window()); | 682 root_window_->window()); |
691 root_window_->host()->Show(); | 683 root_window_->host()->Show(); |
692 | 684 |
693 // Create a shelf if a user is already logged in. | 685 // Create a shelf if a user is already logged in. |
694 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) | 686 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) |
695 shelf()->CreateShelf(); | 687 shelf()->CreateShelf(); |
696 } | 688 } |
697 | |
698 solo_window_tracker_.reset(new SoloWindowTracker(root_window_.get())); | |
699 if (docked_layout_manager_) | |
700 docked_layout_manager_->AddObserver(solo_window_tracker_.get()); | |
701 } | 689 } |
702 | 690 |
703 void RootWindowController::InitLayoutManagers() { | 691 void RootWindowController::InitLayoutManagers() { |
704 root_window_layout_ = new RootWindowLayoutManager(root_window()); | 692 root_window_layout_ = new RootWindowLayoutManager(root_window()); |
705 root_window()->SetLayoutManager(root_window_layout_); | 693 root_window()->SetLayoutManager(root_window_layout_); |
706 | 694 |
707 aura::Window* default_container = | 695 aura::Window* default_container = |
708 GetContainer(kShellWindowId_DefaultContainer); | 696 GetContainer(kShellWindowId_DefaultContainer); |
709 // Workspace manager has its own layout managers. | 697 // Workspace manager has its own layout managers. |
710 workspace_controller_.reset( | 698 workspace_controller_.reset( |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 DisableTouchHudProjection(); | 980 DisableTouchHudProjection(); |
993 } | 981 } |
994 | 982 |
995 RootWindowController* GetRootWindowController( | 983 RootWindowController* GetRootWindowController( |
996 const aura::Window* root_window) { | 984 const aura::Window* root_window) { |
997 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 985 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
998 } | 986 } |
999 | 987 |
1000 } // namespace internal | 988 } // namespace internal |
1001 } // namespace ash | 989 } // namespace ash |
OLD | NEW |