| 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 |
| 11 #include "ash/accelerators/accelerator_controller_delegate_aura.h" | 11 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 12 #include "ash/accelerators/accelerator_delegate.h" | 12 #include "ash/accelerators/accelerator_delegate.h" |
| 13 #include "ash/aura/wm_shell_aura.h" | 13 #include "ash/aura/wm_shell_aura.h" |
| 14 #include "ash/aura/wm_window_aura.h" | 14 #include "ash/aura/wm_window_aura.h" |
| 15 #include "ash/autoclick/autoclick_controller.h" | 15 #include "ash/autoclick/autoclick_controller.h" |
| 16 #include "ash/common/accelerators/accelerator_controller.h" | 16 #include "ash/common/accelerators/accelerator_controller.h" |
| 17 #include "ash/common/frame/custom_frame_view_ash.h" | 17 #include "ash/common/frame/custom_frame_view_ash.h" |
| 18 #include "ash/common/gpu_support.h" | 18 #include "ash/common/gpu_support.h" |
| 19 #include "ash/common/keyboard/keyboard_ui.h" | 19 #include "ash/common/keyboard/keyboard_ui.h" |
| 20 #include "ash/common/login_status.h" | 20 #include "ash/common/login_status.h" |
| 21 #include "ash/common/session/session_state_delegate.h" | 21 #include "ash/common/session/session_state_delegate.h" |
| 22 #include "ash/common/shelf/app_list_shelf_item_delegate.h" | 22 #include "ash/common/shelf/app_list_shelf_item_delegate.h" |
| 23 #include "ash/common/shelf/shelf_delegate.h" | 23 #include "ash/common/shelf/shelf_delegate.h" |
| 24 #include "ash/common/shelf/shelf_item_delegate.h" | 24 #include "ash/common/shelf/shelf_item_delegate.h" |
| 25 #include "ash/common/shelf/shelf_model.h" | 25 #include "ash/common/shelf/shelf_model.h" |
| 26 #include "ash/common/shelf/wm_shelf.h" | 26 #include "ash/common/shelf/wm_shelf.h" |
| 27 #include "ash/common/shell_delegate.h" | 27 #include "ash/common/shell_delegate.h" |
| 28 #include "ash/common/shell_window_ids.h" | 28 #include "ash/common/shell_window_ids.h" |
| 29 #include "ash/common/system/locale/locale_notification_controller.h" | |
| 30 #include "ash/common/system/status_area_widget.h" | 29 #include "ash/common/system/status_area_widget.h" |
| 31 #include "ash/common/system/tray/system_tray_delegate.h" | 30 #include "ash/common/system/tray/system_tray_delegate.h" |
| 32 #include "ash/common/wallpaper/wallpaper_delegate.h" | 31 #include "ash/common/wallpaper/wallpaper_delegate.h" |
| 33 #include "ash/common/wm/container_finder.h" | 32 #include "ash/common/wm/container_finder.h" |
| 34 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 33 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 35 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" | 34 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
| 36 #include "ash/common/wm/mru_window_tracker.h" | 35 #include "ash/common/wm/mru_window_tracker.h" |
| 37 #include "ash/common/wm/root_window_finder.h" | 36 #include "ash/common/wm/root_window_finder.h" |
| 38 #include "ash/common/wm/system_modal_container_layout_manager.h" | 37 #include "ash/common/wm/system_modal_container_layout_manager.h" |
| 39 #include "ash/common/wm/window_positioner.h" | 38 #include "ash/common/wm/window_positioner.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 467 |
| 469 // Destroy toasts | 468 // Destroy toasts |
| 470 wm_shell_->DeleteToastManager(); | 469 wm_shell_->DeleteToastManager(); |
| 471 | 470 |
| 472 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure | 471 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure |
| 473 // to deinitialize the shelf first, as it is initialized after the delegate. | 472 // to deinitialize the shelf first, as it is initialized after the delegate. |
| 474 for (WmWindow* root : wm_shell_->GetAllRootWindows()) | 473 for (WmWindow* root : wm_shell_->GetAllRootWindows()) |
| 475 root->GetRootWindowController()->GetShelf()->ShutdownShelfWidget(); | 474 root->GetRootWindowController()->GetShelf()->ShutdownShelfWidget(); |
| 476 wm_shell_->DeleteSystemTrayDelegate(); | 475 wm_shell_->DeleteSystemTrayDelegate(); |
| 477 | 476 |
| 478 locale_notification_controller_.reset(); | |
| 479 | |
| 480 // Drag-and-drop must be canceled prior to close all windows. | 477 // Drag-and-drop must be canceled prior to close all windows. |
| 481 drag_drop_controller_.reset(); | 478 drag_drop_controller_.reset(); |
| 482 | 479 |
| 483 // Controllers who have WindowObserver added must be deleted | 480 // Controllers who have WindowObserver added must be deleted |
| 484 // before |window_tree_host_manager_| is deleted. | 481 // before |window_tree_host_manager_| is deleted. |
| 485 | 482 |
| 486 #if defined(OS_CHROMEOS) | 483 #if defined(OS_CHROMEOS) |
| 487 // VideoActivityNotifier must be deleted before |video_detector_| is | 484 // VideoActivityNotifier must be deleted before |video_detector_| is |
| 488 // deleted because it's observing video activity through | 485 // deleted because it's observing video activity through |
| 489 // VideoDetector::Observer interface. | 486 // VideoDetector::Observer interface. |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 session_state_delegate_.reset( | 768 session_state_delegate_.reset( |
| 772 wm_shell_->delegate()->CreateSessionStateDelegate()); | 769 wm_shell_->delegate()->CreateSessionStateDelegate()); |
| 773 wm_shell_->CreatePointerWatcherAdapter(); | 770 wm_shell_->CreatePointerWatcherAdapter(); |
| 774 | 771 |
| 775 resize_shadow_controller_.reset(new ResizeShadowController()); | 772 resize_shadow_controller_.reset(new ResizeShadowController()); |
| 776 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); | 773 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); |
| 777 | 774 |
| 778 wm_shell_->SetSystemTrayDelegate( | 775 wm_shell_->SetSystemTrayDelegate( |
| 779 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); | 776 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); |
| 780 | 777 |
| 781 locale_notification_controller_.reset(new LocaleNotificationController); | |
| 782 | |
| 783 #if defined(OS_CHROMEOS) | 778 #if defined(OS_CHROMEOS) |
| 784 // Create TouchTransformerController before | 779 // Create TouchTransformerController before |
| 785 // WindowTreeHostManager::InitDisplays() | 780 // WindowTreeHostManager::InitDisplays() |
| 786 // since TouchTransformerController listens on | 781 // since TouchTransformerController listens on |
| 787 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). | 782 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). |
| 788 touch_transformer_controller_.reset(new TouchTransformerController()); | 783 touch_transformer_controller_.reset(new TouchTransformerController()); |
| 789 #endif // defined(OS_CHROMEOS) | 784 #endif // defined(OS_CHROMEOS) |
| 790 | 785 |
| 791 wm_shell_->SetKeyboardUI(KeyboardUI::Create()); | 786 wm_shell_->SetKeyboardUI(KeyboardUI::Create()); |
| 792 | 787 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 892 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |
| 898 return std::unique_ptr<ui::EventTargetIterator>(); | 893 return std::unique_ptr<ui::EventTargetIterator>(); |
| 899 } | 894 } |
| 900 | 895 |
| 901 ui::EventTargeter* Shell::GetEventTargeter() { | 896 ui::EventTargeter* Shell::GetEventTargeter() { |
| 902 NOTREACHED(); | 897 NOTREACHED(); |
| 903 return nullptr; | 898 return nullptr; |
| 904 } | 899 } |
| 905 | 900 |
| 906 } // namespace ash | 901 } // namespace ash |
| OLD | NEW |