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