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/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "ash/shelf/shelf_item_delegate.h" | 42 #include "ash/shelf/shelf_item_delegate.h" |
43 #include "ash/shelf/shelf_item_delegate_manager.h" | 43 #include "ash/shelf/shelf_item_delegate_manager.h" |
44 #include "ash/shelf/shelf_layout_manager.h" | 44 #include "ash/shelf/shelf_layout_manager.h" |
45 #include "ash/shelf/shelf_model.h" | 45 #include "ash/shelf/shelf_model.h" |
46 #include "ash/shelf/shelf_widget.h" | 46 #include "ash/shelf/shelf_widget.h" |
47 #include "ash/shelf/shelf_window_watcher.h" | 47 #include "ash/shelf/shelf_window_watcher.h" |
48 #include "ash/shell_delegate.h" | 48 #include "ash/shell_delegate.h" |
49 #include "ash/shell_factory.h" | 49 #include "ash/shell_factory.h" |
50 #include "ash/shell_init_params.h" | 50 #include "ash/shell_init_params.h" |
51 #include "ash/shell_window_ids.h" | 51 #include "ash/shell_window_ids.h" |
| 52 #include "ash/surfaces/surface_controller.h" |
52 #include "ash/system/locale/locale_notification_controller.h" | 53 #include "ash/system/locale/locale_notification_controller.h" |
53 #include "ash/system/status_area_widget.h" | 54 #include "ash/system/status_area_widget.h" |
54 #include "ash/system/tray/system_tray_delegate.h" | 55 #include "ash/system/tray/system_tray_delegate.h" |
55 #include "ash/system/tray/system_tray_notifier.h" | 56 #include "ash/system/tray/system_tray_notifier.h" |
56 #include "ash/utility/partial_screenshot_controller.h" | 57 #include "ash/utility/partial_screenshot_controller.h" |
57 #include "ash/wm/app_list_controller.h" | 58 #include "ash/wm/app_list_controller.h" |
58 #include "ash/wm/ash_focus_rules.h" | 59 #include "ash/wm/ash_focus_rules.h" |
59 #include "ash/wm/ash_native_cursor_manager.h" | 60 #include "ash/wm/ash_native_cursor_manager.h" |
60 #include "ash/wm/coordinate_conversion.h" | 61 #include "ash/wm/coordinate_conversion.h" |
61 #include "ash/wm/event_client_impl.h" | 62 #include "ash/wm/event_client_impl.h" |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 scoped_ptr<::wm::NativeCursorManager>(native_cursor_manager_)), | 648 scoped_ptr<::wm::NativeCursorManager>(native_cursor_manager_)), |
648 simulate_modal_window_open_for_testing_(false), | 649 simulate_modal_window_open_for_testing_(false), |
649 is_touch_hud_projection_enabled_(false), | 650 is_touch_hud_projection_enabled_(false), |
650 blocking_pool_(blocking_pool) { | 651 blocking_pool_(blocking_pool) { |
651 DCHECK(delegate_.get()); | 652 DCHECK(delegate_.get()); |
652 DCHECK(aura::Env::GetInstanceDontCreate()); | 653 DCHECK(aura::Env::GetInstanceDontCreate()); |
653 gpu_support_.reset(delegate_->CreateGPUSupport()); | 654 gpu_support_.reset(delegate_->CreateGPUSupport()); |
654 display_manager_.reset(new DisplayManager); | 655 display_manager_.reset(new DisplayManager); |
655 window_tree_host_manager_.reset(new WindowTreeHostManager); | 656 window_tree_host_manager_.reset(new WindowTreeHostManager); |
656 user_metrics_recorder_.reset(new UserMetricsRecorder); | 657 user_metrics_recorder_.reset(new UserMetricsRecorder); |
| 658 surface_controller_.reset(new SurfaceController); |
657 | 659 |
658 #if defined(OS_CHROMEOS) | 660 #if defined(OS_CHROMEOS) |
659 PowerStatus::Initialize(); | 661 PowerStatus::Initialize(); |
660 #endif | 662 #endif |
661 } | 663 } |
662 | 664 |
663 Shell::~Shell() { | 665 Shell::~Shell() { |
664 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); | 666 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); |
665 | 667 |
666 user_metrics_recorder_->OnShellShuttingDown(); | 668 user_metrics_recorder_->OnShellShuttingDown(); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 toplevel_window_event_handler_.reset(); | 788 toplevel_window_event_handler_.reset(); |
787 visibility_controller_.reset(); | 789 visibility_controller_.reset(); |
788 // |shelf_item_delegate_manager_| observes |shelf_model_|. It must be | 790 // |shelf_item_delegate_manager_| observes |shelf_model_|. It must be |
789 // destroyed before |shelf_model_| is destroyed. | 791 // destroyed before |shelf_model_| is destroyed. |
790 shelf_item_delegate_manager_.reset(); | 792 shelf_item_delegate_manager_.reset(); |
791 shelf_model_.reset(); | 793 shelf_model_.reset(); |
792 | 794 |
793 power_button_controller_.reset(); | 795 power_button_controller_.reset(); |
794 lock_state_controller_.reset(); | 796 lock_state_controller_.reset(); |
795 | 797 |
| 798 surface_controller_.reset(); |
| 799 |
796 #if defined(OS_CHROMEOS) | 800 #if defined(OS_CHROMEOS) |
797 resolution_notification_controller_.reset(); | 801 resolution_notification_controller_.reset(); |
798 #endif | 802 #endif |
799 desktop_background_controller_.reset(); | 803 desktop_background_controller_.reset(); |
800 partial_screenshot_controller_.reset(); | 804 partial_screenshot_controller_.reset(); |
801 mouse_cursor_filter_.reset(); | 805 mouse_cursor_filter_.reset(); |
802 | 806 |
803 #if defined(OS_CHROMEOS) | 807 #if defined(OS_CHROMEOS) |
804 touch_transformer_controller_.reset(); | 808 touch_transformer_controller_.reset(); |
805 #endif // defined(OS_CHROMEOS) | 809 #endif // defined(OS_CHROMEOS) |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 | 1190 |
1187 void Shell::OnWindowActivated( | 1191 void Shell::OnWindowActivated( |
1188 aura::client::ActivationChangeObserver::ActivationReason reason, | 1192 aura::client::ActivationChangeObserver::ActivationReason reason, |
1189 aura::Window* gained_active, | 1193 aura::Window* gained_active, |
1190 aura::Window* lost_active) { | 1194 aura::Window* lost_active) { |
1191 if (gained_active) | 1195 if (gained_active) |
1192 target_root_window_ = gained_active->GetRootWindow(); | 1196 target_root_window_ = gained_active->GetRootWindow(); |
1193 } | 1197 } |
1194 | 1198 |
1195 } // namespace ash | 1199 } // namespace ash |
OLD | NEW |