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/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/shell_factory.h" | 11 #include "ash/shell_factory.h" |
12 #include "ash/shell_window_ids.h" | 12 #include "ash/shell_window_ids.h" |
13 #include "ash/wm/base_layout_manager.h" | 13 #include "ash/wm/base_layout_manager.h" |
14 #include "ash/wm/event_client_impl.h" | 14 #include "ash/wm/event_client_impl.h" |
15 #include "ash/wm/property_util.h" | 15 #include "ash/wm/property_util.h" |
16 #include "ash/wm/root_window_layout_manager.h" | 16 #include "ash/wm/root_window_layout_manager.h" |
17 #include "ash/wm/screen_dimmer.h" | 17 #include "ash/wm/screen_dimmer.h" |
18 #include "ash/wm/system_modal_container_layout_manager.h" | 18 #include "ash/wm/system_modal_container_layout_manager.h" |
19 #include "ash/wm/toplevel_window_event_filter.h" | 19 #include "ash/wm/toplevel_window_event_filter.h" |
20 #include "ash/wm/visibility_controller.h" | 20 #include "ash/wm/visibility_controller.h" |
21 #include "ash/wm/window_properties.h" | 21 #include "ash/wm/window_properties.h" |
22 #include "ash/wm/workspace/workspace_manager.h" | |
23 #include "ash/wm/workspace_controller.h" | 22 #include "ash/wm/workspace_controller.h" |
24 #include "ui/aura/client/activation_client.h" | 23 #include "ui/aura/client/activation_client.h" |
25 #include "ui/aura/client/aura_constants.h" | 24 #include "ui/aura/client/aura_constants.h" |
26 #include "ui/aura/client/capture_client.h" | 25 #include "ui/aura/client/capture_client.h" |
27 #include "ui/aura/client/tooltip_client.h" | 26 #include "ui/aura/client/tooltip_client.h" |
28 #include "ui/aura/focus_manager.h" | 27 #include "ui/aura/focus_manager.h" |
29 #include "ui/aura/root_window.h" | 28 #include "ui/aura/root_window.h" |
30 #include "ui/aura/window.h" | 29 #include "ui/aura/window.h" |
31 #include "ui/aura/window_observer.h" | 30 #include "ui/aura/window_observer.h" |
32 #include "ui/aura/window_tracker.h" | 31 #include "ui/aura/window_tracker.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 workspace_controller_.reset(); | 281 workspace_controller_.reset(); |
283 aura::client::SetTooltipClient(root_window_.get(), NULL); | 282 aura::client::SetTooltipClient(root_window_.get(), NULL); |
284 | 283 |
285 while (!root_window_->children().empty()) { | 284 while (!root_window_->children().empty()) { |
286 aura::Window* child = root_window_->children()[0]; | 285 aura::Window* child = root_window_->children()[0]; |
287 delete child; | 286 delete child; |
288 } | 287 } |
289 } | 288 } |
290 | 289 |
291 bool RootWindowController::IsInMaximizedMode() const { | 290 bool RootWindowController::IsInMaximizedMode() const { |
292 return workspace_controller_->workspace_manager()->IsInMaximizedMode(); | 291 return workspace_controller_->IsInMaximizedMode(); |
293 } | 292 } |
294 | 293 |
295 void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) { | 294 void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) { |
296 aura::Window* focused = dst->GetFocusManager()->GetFocusedWindow(); | 295 aura::Window* focused = dst->GetFocusManager()->GetFocusedWindow(); |
297 aura::client::ActivationClient* activation_client = | 296 aura::client::ActivationClient* activation_client = |
298 aura::client::GetActivationClient(dst); | 297 aura::client::GetActivationClient(dst); |
299 aura::Window* active = activation_client->GetActiveWindow(); | 298 aura::Window* active = activation_client->GetActiveWindow(); |
300 // Deactivate the window to close menu / bubble windows. | 299 // Deactivate the window to close menu / bubble windows. |
301 activation_client->DeactivateWindow(active); | 300 activation_client->DeactivateWindow(active); |
302 // Release capture if any. | 301 // Release capture if any. |
(...skipping 10 matching lines...) Expand all Loading... |
313 // Restore focused or active window if it's still alive. | 312 // Restore focused or active window if it's still alive. |
314 if (focused && tracker.Contains(focused) && dst->Contains(focused)) { | 313 if (focused && tracker.Contains(focused) && dst->Contains(focused)) { |
315 dst->GetFocusManager()->SetFocusedWindow(focused, NULL); | 314 dst->GetFocusManager()->SetFocusedWindow(focused, NULL); |
316 } else if (active && tracker.Contains(active) && dst->Contains(active)) { | 315 } else if (active && tracker.Contains(active) && dst->Contains(active)) { |
317 activation_client->ActivateWindow(active); | 316 activation_client->ActivateWindow(active); |
318 } | 317 } |
319 } | 318 } |
320 | 319 |
321 } // namespace internal | 320 } // namespace internal |
322 } // namespace ash | 321 } // namespace ash |
OLD | NEW |