| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "ash/wm/overview/scoped_overview_animation_settings_factory_aura.h" | 72 #include "ash/wm/overview/scoped_overview_animation_settings_factory_aura.h" |
| 73 #include "ash/wm/power_button_controller.h" | 73 #include "ash/wm/power_button_controller.h" |
| 74 #include "ash/wm/resize_shadow_controller.h" | 74 #include "ash/wm/resize_shadow_controller.h" |
| 75 #include "ash/wm/screen_pinning_controller.h" | 75 #include "ash/wm/screen_pinning_controller.h" |
| 76 #include "ash/wm/system_gesture_event_filter.h" | 76 #include "ash/wm/system_gesture_event_filter.h" |
| 77 #include "ash/wm/system_modal_container_event_filter.h" | 77 #include "ash/wm/system_modal_container_event_filter.h" |
| 78 #include "ash/wm/system_modal_container_layout_manager.h" | 78 #include "ash/wm/system_modal_container_layout_manager.h" |
| 79 #include "ash/wm/toplevel_window_event_handler.h" | 79 #include "ash/wm/toplevel_window_event_handler.h" |
| 80 #include "ash/wm/video_detector.h" | 80 #include "ash/wm/video_detector.h" |
| 81 #include "ash/wm/window_animations.h" | 81 #include "ash/wm/window_animations.h" |
| 82 #include "ash/wm/window_cycle_controller.h" | |
| 83 #include "ash/wm/window_properties.h" | 82 #include "ash/wm/window_properties.h" |
| 84 #include "ash/wm/window_util.h" | 83 #include "ash/wm/window_util.h" |
| 85 #include "ash/wm/workspace_controller.h" | 84 #include "ash/wm/workspace_controller.h" |
| 86 #include "base/bind.h" | 85 #include "base/bind.h" |
| 87 #include "base/memory/ptr_util.h" | 86 #include "base/memory/ptr_util.h" |
| 88 #include "base/trace_event/trace_event.h" | 87 #include "base/trace_event/trace_event.h" |
| 89 #include "ui/app_list/presenter/app_list_presenter.h" | 88 #include "ui/app_list/presenter/app_list_presenter.h" |
| 90 #include "ui/aura/client/aura_constants.h" | 89 #include "ui/aura/client/aura_constants.h" |
| 91 #include "ui/aura/env.h" | 90 #include "ui/aura/env.h" |
| 92 #include "ui/aura/layout_manager.h" | 91 #include "ui/aura/layout_manager.h" |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 // deleted because it's observing video activity through | 695 // deleted because it's observing video activity through |
| 697 // VideoDetector::Observer interface. | 696 // VideoDetector::Observer interface. |
| 698 video_activity_notifier_.reset(); | 697 video_activity_notifier_.reset(); |
| 699 #endif // defined(OS_CHROMEOS) | 698 #endif // defined(OS_CHROMEOS) |
| 700 video_detector_.reset(); | 699 video_detector_.reset(); |
| 701 high_contrast_controller_.reset(); | 700 high_contrast_controller_.reset(); |
| 702 | 701 |
| 703 shadow_controller_.reset(); | 702 shadow_controller_.reset(); |
| 704 resize_shadow_controller_.reset(); | 703 resize_shadow_controller_.reset(); |
| 705 | 704 |
| 706 window_cycle_controller_.reset(); | 705 // Has to happen before ~MruWindowTracker. |
| 706 wm_shell_->DeleteWindowCycleController(); |
| 707 wm_shell_->DeleteWindowSelectorController(); | 707 wm_shell_->DeleteWindowSelectorController(); |
| 708 | 708 |
| 709 // |shelf_window_watcher_| has a weak pointer to |shelf_Model_| | 709 // |shelf_window_watcher_| has a weak pointer to |shelf_Model_| |
| 710 // and has window observers. | 710 // and has window observers. |
| 711 shelf_window_watcher_.reset(); | 711 shelf_window_watcher_.reset(); |
| 712 | 712 |
| 713 // Destroy all child windows including widgets. | 713 // Destroy all child windows including widgets. |
| 714 window_tree_host_manager_->CloseChildWindows(); | 714 window_tree_host_manager_->CloseChildWindows(); |
| 715 // MruWindowTracker must be destroyed after all windows have been deleted to | 715 // MruWindowTracker must be destroyed after all windows have been deleted to |
| 716 // avoid a possible crash when Shell is destroyed from a non-normal shutdown | 716 // avoid a possible crash when Shell is destroyed from a non-normal shutdown |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 | 987 |
| 988 magnification_controller_.reset(MagnificationController::CreateInstance()); | 988 magnification_controller_.reset(MagnificationController::CreateInstance()); |
| 989 wm_shell_->CreateMruWindowTracker(); | 989 wm_shell_->CreateMruWindowTracker(); |
| 990 | 990 |
| 991 partial_magnification_controller_.reset(new PartialMagnificationController()); | 991 partial_magnification_controller_.reset(new PartialMagnificationController()); |
| 992 | 992 |
| 993 autoclick_controller_.reset(AutoclickController::CreateInstance()); | 993 autoclick_controller_.reset(AutoclickController::CreateInstance()); |
| 994 | 994 |
| 995 high_contrast_controller_.reset(new HighContrastController); | 995 high_contrast_controller_.reset(new HighContrastController); |
| 996 video_detector_.reset(new VideoDetector); | 996 video_detector_.reset(new VideoDetector); |
| 997 window_cycle_controller_.reset(new WindowCycleController()); | |
| 998 | 997 |
| 999 tooltip_controller_.reset(new views::corewm::TooltipController( | 998 tooltip_controller_.reset(new views::corewm::TooltipController( |
| 1000 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); | 999 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); |
| 1001 AddPreTargetHandler(tooltip_controller_.get()); | 1000 AddPreTargetHandler(tooltip_controller_.get()); |
| 1002 | 1001 |
| 1003 modality_filter_.reset(new SystemModalContainerEventFilter(this)); | 1002 modality_filter_.reset(new SystemModalContainerEventFilter(this)); |
| 1004 AddPreTargetHandler(modality_filter_.get()); | 1003 AddPreTargetHandler(modality_filter_.get()); |
| 1005 | 1004 |
| 1006 event_client_.reset(new EventClientImpl); | 1005 event_client_.reset(new EventClientImpl); |
| 1007 | 1006 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 | 1162 |
| 1164 void Shell::OnWindowActivated( | 1163 void Shell::OnWindowActivated( |
| 1165 aura::client::ActivationChangeObserver::ActivationReason reason, | 1164 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1166 aura::Window* gained_active, | 1165 aura::Window* gained_active, |
| 1167 aura::Window* lost_active) { | 1166 aura::Window* lost_active) { |
| 1168 if (gained_active) | 1167 if (gained_active) |
| 1169 target_root_window_ = gained_active->GetRootWindow(); | 1168 target_root_window_ = gained_active->GetRootWindow(); |
| 1170 } | 1169 } |
| 1171 | 1170 |
| 1172 } // namespace ash | 1171 } // namespace ash |
| OLD | NEW |