| 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/accelerators/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 #include "ash/wm/user_activity_detector.h" | 69 #include "ash/wm/user_activity_detector.h" |
| 70 #include "ash/wm/video_detector.h" | 70 #include "ash/wm/video_detector.h" |
| 71 #include "ash/wm/window_animations.h" | 71 #include "ash/wm/window_animations.h" |
| 72 #include "ash/wm/window_cycle_controller.h" | 72 #include "ash/wm/window_cycle_controller.h" |
| 73 #include "ash/wm/window_properties.h" | 73 #include "ash/wm/window_properties.h" |
| 74 #include "ash/wm/window_util.h" | 74 #include "ash/wm/window_util.h" |
| 75 #include "ash/wm/workspace_controller.h" | 75 #include "ash/wm/workspace_controller.h" |
| 76 #include "base/bind.h" | 76 #include "base/bind.h" |
| 77 #include "base/command_line.h" | 77 #include "base/command_line.h" |
| 78 #include "base/debug/leak_annotations.h" | 78 #include "base/debug/leak_annotations.h" |
| 79 #include "base/debug/trace_event.h" |
| 79 #include "ui/aura/client/aura_constants.h" | 80 #include "ui/aura/client/aura_constants.h" |
| 80 #include "ui/aura/client/user_action_client.h" | 81 #include "ui/aura/client/user_action_client.h" |
| 81 #include "ui/aura/env.h" | 82 #include "ui/aura/env.h" |
| 82 #include "ui/aura/focus_manager.h" | 83 #include "ui/aura/focus_manager.h" |
| 83 #include "ui/aura/layout_manager.h" | 84 #include "ui/aura/layout_manager.h" |
| 84 #include "ui/aura/root_window.h" | 85 #include "ui/aura/root_window.h" |
| 85 #include "ui/aura/window.h" | 86 #include "ui/aura/window.h" |
| 86 #include "ui/base/ui_base_switches.h" | 87 #include "ui/base/ui_base_switches.h" |
| 87 #include "ui/compositor/layer.h" | 88 #include "ui/compositor/layer.h" |
| 88 #include "ui/compositor/layer_animator.h" | 89 #include "ui/compositor/layer_animator.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 base::MessagePumpAuraX11::Current()->AddObserver(output_configurator()); | 240 base::MessagePumpAuraX11::Current()->AddObserver(output_configurator()); |
| 240 #endif // defined(OS_CHROMEOS) | 241 #endif // defined(OS_CHROMEOS) |
| 241 AddPreTargetHandler(this); | 242 AddPreTargetHandler(this); |
| 242 | 243 |
| 243 #if defined(OS_CHROMEOS) | 244 #if defined(OS_CHROMEOS) |
| 244 internal::PowerStatus::Initialize(); | 245 internal::PowerStatus::Initialize(); |
| 245 #endif | 246 #endif |
| 246 } | 247 } |
| 247 | 248 |
| 248 Shell::~Shell() { | 249 Shell::~Shell() { |
| 250 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); |
| 251 |
| 249 views::FocusManagerFactory::Install(NULL); | 252 views::FocusManagerFactory::Install(NULL); |
| 250 | 253 |
| 251 // Remove the focus from any window. This will prevent overhead and side | 254 // Remove the focus from any window. This will prevent overhead and side |
| 252 // effects (e.g. crashes) from changing focus during shutdown. | 255 // effects (e.g. crashes) from changing focus during shutdown. |
| 253 // See bug crbug.com/134502. | 256 // See bug crbug.com/134502. |
| 254 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL); | 257 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL); |
| 255 | 258 |
| 256 // Please keep in same order as in Init() because it's easy to miss one. | 259 // Please keep in same order as in Init() because it's easy to miss one. |
| 257 RemovePreTargetHandler(event_rewriter_filter_.get()); | 260 RemovePreTargetHandler(event_rewriter_filter_.get()); |
| 258 RemovePreTargetHandler(user_activity_detector_.get()); | 261 RemovePreTargetHandler(user_activity_detector_.get()); |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 //////////////////////////////////////////////////////////////////////////////// | 987 //////////////////////////////////////////////////////////////////////////////// |
| 985 // Shell, aura::client::ActivationChangeObserver implementation: | 988 // Shell, aura::client::ActivationChangeObserver implementation: |
| 986 | 989 |
| 987 void Shell::OnWindowActivated(aura::Window* gained_active, | 990 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 988 aura::Window* lost_active) { | 991 aura::Window* lost_active) { |
| 989 if (gained_active) | 992 if (gained_active) |
| 990 target_root_window_ = gained_active->GetRootWindow(); | 993 target_root_window_ = gained_active->GetRootWindow(); |
| 991 } | 994 } |
| 992 | 995 |
| 993 } // namespace ash | 996 } // namespace ash |
| OLD | NEW |