| 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" |
| 11 #include "ash/ash_switches.h" | 11 #include "ash/ash_switches.h" |
| 12 #include "ash/caps_lock_delegate.h" | 12 #include "ash/caps_lock_delegate.h" |
| 13 #include "ash/desktop_background/desktop_background_controller.h" | 13 #include "ash/desktop_background/desktop_background_controller.h" |
| 14 #include "ash/desktop_background/desktop_background_view.h" | 14 #include "ash/desktop_background/desktop_background_view.h" |
| 15 #include "ash/desktop_background/user_wallpaper_delegate.h" | 15 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 16 #include "ash/display/display_controller.h" | 16 #include "ash/display/display_controller.h" |
| 17 #include "ash/display/display_manager.h" | 17 #include "ash/display/display_manager.h" |
| 18 #include "ash/display/event_transformation_handler.h" | 18 #include "ash/display/event_transformation_handler.h" |
| 19 #include "ash/display/mirror_window_controller.h" |
| 19 #include "ash/display/mouse_cursor_event_filter.h" | 20 #include "ash/display/mouse_cursor_event_filter.h" |
| 20 #include "ash/display/screen_position_controller.h" | 21 #include "ash/display/screen_position_controller.h" |
| 21 #include "ash/drag_drop/drag_drop_controller.h" | 22 #include "ash/drag_drop/drag_drop_controller.h" |
| 22 #include "ash/focus_cycler.h" | 23 #include "ash/focus_cycler.h" |
| 23 #include "ash/high_contrast/high_contrast_controller.h" | 24 #include "ash/high_contrast/high_contrast_controller.h" |
| 24 #include "ash/host/root_window_host_factory.h" | 25 #include "ash/host/root_window_host_factory.h" |
| 25 #include "ash/launcher/launcher_delegate.h" | 26 #include "ash/launcher/launcher_delegate.h" |
| 26 #include "ash/launcher/launcher_model.h" | 27 #include "ash/launcher/launcher_model.h" |
| 27 #include "ash/magnifier/magnification_controller.h" | 28 #include "ash/magnifier/magnification_controller.h" |
| 28 #include "ash/magnifier/partial_magnification_controller.h" | 29 #include "ash/magnifier/partial_magnification_controller.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 nested_dispatcher_controller_.reset(); | 292 nested_dispatcher_controller_.reset(); |
| 292 user_action_client_.reset(); | 293 user_action_client_.reset(); |
| 293 visibility_controller_.reset(); | 294 visibility_controller_.reset(); |
| 294 launcher_delegate_.reset(); | 295 launcher_delegate_.reset(); |
| 295 launcher_model_.reset(); | 296 launcher_model_.reset(); |
| 296 video_detector_.reset(); | 297 video_detector_.reset(); |
| 297 | 298 |
| 298 power_button_controller_.reset(); | 299 power_button_controller_.reset(); |
| 299 session_state_controller_.reset(); | 300 session_state_controller_.reset(); |
| 300 | 301 |
| 302 mirror_window_controller_.reset(); |
| 303 |
| 301 // This also deletes all RootWindows. Note that we invoke Shutdown() on | 304 // This also deletes all RootWindows. Note that we invoke Shutdown() on |
| 302 // DisplayController before resetting |display_controller_|, since destruction | 305 // DisplayController before resetting |display_controller_|, since destruction |
| 303 // of its owned RootWindowControllers relies on the value. | 306 // of its owned RootWindowControllers relies on the value. |
| 304 display_controller_->Shutdown(); | 307 display_controller_->Shutdown(); |
| 305 display_controller_.reset(); | 308 display_controller_.reset(); |
| 306 screen_position_controller_.reset(); | 309 screen_position_controller_.reset(); |
| 307 | 310 |
| 308 // Delete the activation controller after other controllers and launcher | 311 // Delete the activation controller after other controllers and launcher |
| 309 // because they might have registered ActivationChangeObserver. | 312 // because they might have registered ActivationChangeObserver. |
| 310 activation_controller_.reset(); | 313 activation_controller_.reset(); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 focus_client_.get(), | 465 focus_client_.get(), |
| 463 new internal::AshActivationController)); | 466 new internal::AshActivationController)); |
| 464 activation_client_ = activation_controller_.get(); | 467 activation_client_ = activation_controller_.get(); |
| 465 AddPreTargetHandler(activation_controller_.get()); | 468 AddPreTargetHandler(activation_controller_.get()); |
| 466 } | 469 } |
| 467 | 470 |
| 468 focus_cycler_.reset(new internal::FocusCycler()); | 471 focus_cycler_.reset(new internal::FocusCycler()); |
| 469 | 472 |
| 470 screen_position_controller_.reset(new internal::ScreenPositionController); | 473 screen_position_controller_.reset(new internal::ScreenPositionController); |
| 471 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); | 474 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); |
| 475 |
| 476 mirror_window_controller_.reset(new internal::MirrorWindowController); |
| 472 display_controller_->Start(); | 477 display_controller_->Start(); |
| 473 display_controller_->InitPrimaryDisplay(); | 478 display_controller_->InitPrimaryDisplay(); |
| 474 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); | 479 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); |
| 475 active_root_window_ = root_window; | 480 active_root_window_ = root_window; |
| 476 | 481 |
| 477 cursor_manager_.SetDisplay(DisplayController::GetPrimaryDisplay()); | 482 cursor_manager_.SetDisplay(DisplayController::GetPrimaryDisplay()); |
| 478 | 483 |
| 479 #if !defined(OS_MACOSX) | 484 #if !defined(OS_MACOSX) |
| 480 nested_dispatcher_controller_.reset(new NestedDispatcherController); | 485 nested_dispatcher_controller_.reset(new NestedDispatcherController); |
| 481 accelerator_controller_.reset(new AcceleratorController); | 486 accelerator_controller_.reset(new AcceleratorController); |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 //////////////////////////////////////////////////////////////////////////////// | 952 //////////////////////////////////////////////////////////////////////////////// |
| 948 // Shell, aura::client::ActivationChangeObserver implementation: | 953 // Shell, aura::client::ActivationChangeObserver implementation: |
| 949 | 954 |
| 950 void Shell::OnWindowActivated(aura::Window* gained_active, | 955 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 951 aura::Window* lost_active) { | 956 aura::Window* lost_active) { |
| 952 if (gained_active) | 957 if (gained_active) |
| 953 active_root_window_ = gained_active->GetRootWindow(); | 958 active_root_window_ = gained_active->GetRootWindow(); |
| 954 } | 959 } |
| 955 | 960 |
| 956 } // namespace ash | 961 } // namespace ash |
| OLD | NEW |