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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/desktop_background/desktop_background_widget_controller.h" | 9 #include "ash/desktop_background/desktop_background_widget_controller.h" |
10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
11 #include "ash/display/multi_display_manager.h" | 11 #include "ash/display/multi_display_manager.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/shell_factory.h" | 13 #include "ash/shell_factory.h" |
14 #include "ash/shell_window_ids.h" | 14 #include "ash/shell_window_ids.h" |
15 #include "ash/wm/base_layout_manager.h" | 15 #include "ash/wm/base_layout_manager.h" |
16 #include "ash/wm/event_client_impl.h" | |
17 #include "ash/wm/property_util.h" | 16 #include "ash/wm/property_util.h" |
18 #include "ash/wm/root_window_layout_manager.h" | 17 #include "ash/wm/root_window_layout_manager.h" |
19 #include "ash/wm/screen_dimmer.h" | 18 #include "ash/wm/screen_dimmer.h" |
20 #include "ash/wm/system_modal_container_layout_manager.h" | 19 #include "ash/wm/system_modal_container_layout_manager.h" |
21 #include "ash/wm/toplevel_window_event_handler.h" | 20 #include "ash/wm/toplevel_window_event_handler.h" |
22 #include "ash/wm/visibility_controller.h" | 21 #include "ash/wm/visibility_controller.h" |
23 #include "ash/wm/window_properties.h" | 22 #include "ash/wm/window_properties.h" |
24 #include "ash/wm/workspace/system_background_controller.h" | 23 #include "ash/wm/workspace/system_background_controller.h" |
25 #include "ash/wm/workspace_controller.h" | 24 #include "ash/wm/workspace_controller.h" |
26 #include "ui/aura/client/activation_client.h" | 25 #include "ui/aura/client/activation_client.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 container->SetProperty(internal::kUsesScreenCoordinatesKey, true); | 136 container->SetProperty(internal::kUsesScreenCoordinatesKey, true); |
138 } | 137 } |
139 | 138 |
140 } // namespace | 139 } // namespace |
141 | 140 |
142 namespace internal { | 141 namespace internal { |
143 | 142 |
144 RootWindowController::RootWindowController(aura::RootWindow* root_window) | 143 RootWindowController::RootWindowController(aura::RootWindow* root_window) |
145 : root_window_(root_window) { | 144 : root_window_(root_window) { |
146 SetRootWindowController(root_window, this); | 145 SetRootWindowController(root_window, this); |
147 | |
148 event_client_.reset(new EventClientImpl(root_window)); | |
149 screen_dimmer_.reset(new ScreenDimmer(root_window)); | 146 screen_dimmer_.reset(new ScreenDimmer(root_window)); |
150 } | 147 } |
151 | 148 |
152 RootWindowController::~RootWindowController() { | 149 RootWindowController::~RootWindowController() { |
153 Shutdown(); | 150 Shutdown(); |
154 root_window_.reset(); | 151 root_window_.reset(); |
155 } | 152 } |
156 | 153 |
157 void RootWindowController::Shutdown() { | 154 void RootWindowController::Shutdown() { |
158 CloseChildWindows(); | 155 CloseChildWindows(); |
159 if (Shell::GetActiveRootWindow() == root_window_.get()) { | 156 if (Shell::GetActiveRootWindow() == root_window_.get()) { |
160 Shell::GetInstance()->set_active_root_window( | 157 Shell::GetInstance()->set_active_root_window( |
161 Shell::GetPrimaryRootWindow() == root_window_.get() ? | 158 Shell::GetPrimaryRootWindow() == root_window_.get() ? |
162 NULL : Shell::GetPrimaryRootWindow()); | 159 NULL : Shell::GetPrimaryRootWindow()); |
163 } | 160 } |
164 SetRootWindowController(root_window_.get(), NULL); | 161 SetRootWindowController(root_window_.get(), NULL); |
165 event_client_.reset(); | |
166 screen_dimmer_.reset(); | 162 screen_dimmer_.reset(); |
167 workspace_controller_.reset(); | 163 workspace_controller_.reset(); |
168 // Forget with the display ID so that display lookup | 164 // Forget with the display ID so that display lookup |
169 // ends up with invalid display. | 165 // ends up with invalid display. |
170 root_window_->ClearProperty(kDisplayIdKey); | 166 root_window_->ClearProperty(kDisplayIdKey); |
171 // And this root window should no longer process events. | 167 // And this root window should no longer process events. |
172 root_window_->PrepareForShutdown(); | 168 root_window_->PrepareForShutdown(); |
173 } | 169 } |
174 | 170 |
175 SystemModalContainerLayoutManager* | 171 SystemModalContainerLayoutManager* |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 | 420 |
425 aura::Window* overlay_container = CreateContainer( | 421 aura::Window* overlay_container = CreateContainer( |
426 kShellWindowId_OverlayContainer, | 422 kShellWindowId_OverlayContainer, |
427 "OverlayContainer", | 423 "OverlayContainer", |
428 lock_screen_related_containers); | 424 lock_screen_related_containers); |
429 SetUsesScreenCoordinates(overlay_container); | 425 SetUsesScreenCoordinates(overlay_container); |
430 } | 426 } |
431 | 427 |
432 } // namespace internal | 428 } // namespace internal |
433 } // namespace ash | 429 } // namespace ash |
OLD | NEW |