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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 #if defined(OS_CHROMEOS) && defined(USE_X11) | 205 #if defined(OS_CHROMEOS) && defined(USE_X11) |
205 output_configurator_(new chromeos::OutputConfigurator()), | 206 output_configurator_(new chromeos::OutputConfigurator()), |
206 #endif // defined(OS_CHROMEOS) | 207 #endif // defined(OS_CHROMEOS) |
207 native_cursor_manager_(new AshNativeCursorManager), | 208 native_cursor_manager_(new AshNativeCursorManager), |
208 cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>( | 209 cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>( |
209 native_cursor_manager_)), | 210 native_cursor_manager_)), |
210 browser_context_(NULL), | 211 browser_context_(NULL), |
211 simulate_modal_window_open_for_testing_(false) { | 212 simulate_modal_window_open_for_testing_(false) { |
212 DCHECK(delegate_.get()); | 213 DCHECK(delegate_.get()); |
213 display_manager_.reset(new internal::DisplayManager); | 214 display_manager_.reset(new internal::DisplayManager); |
| 215 mirror_window_controller_.reset(new internal::MirrorWindowController); |
| 216 |
214 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 | 217 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 |
215 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); | 218 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); |
216 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) | 219 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) |
217 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); | 220 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); |
218 display_controller_.reset(new DisplayController); | 221 display_controller_.reset(new DisplayController); |
219 #if defined(OS_CHROMEOS) && defined(USE_X11) | 222 #if defined(OS_CHROMEOS) && defined(USE_X11) |
220 bool is_panel_fitting_disabled = | 223 bool is_panel_fitting_disabled = |
221 content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( | 224 content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( |
222 content::GPU_FEATURE_TYPE_PANEL_FITTING) || | 225 content::GPU_FEATURE_TYPE_PANEL_FITTING) || |
223 CommandLine::ForCurrentProcess()->HasSwitch( | 226 CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 nested_dispatcher_controller_.reset(); | 294 nested_dispatcher_controller_.reset(); |
292 user_action_client_.reset(); | 295 user_action_client_.reset(); |
293 visibility_controller_.reset(); | 296 visibility_controller_.reset(); |
294 launcher_delegate_.reset(); | 297 launcher_delegate_.reset(); |
295 launcher_model_.reset(); | 298 launcher_model_.reset(); |
296 video_detector_.reset(); | 299 video_detector_.reset(); |
297 | 300 |
298 power_button_controller_.reset(); | 301 power_button_controller_.reset(); |
299 session_state_controller_.reset(); | 302 session_state_controller_.reset(); |
300 | 303 |
| 304 mirror_window_controller_.reset(); |
| 305 |
301 // This also deletes all RootWindows. Note that we invoke Shutdown() on | 306 // This also deletes all RootWindows. Note that we invoke Shutdown() on |
302 // DisplayController before resetting |display_controller_|, since destruction | 307 // DisplayController before resetting |display_controller_|, since destruction |
303 // of its owned RootWindowControllers relies on the value. | 308 // of its owned RootWindowControllers relies on the value. |
304 display_controller_->Shutdown(); | 309 display_controller_->Shutdown(); |
305 display_controller_.reset(); | 310 display_controller_.reset(); |
306 screen_position_controller_.reset(); | 311 screen_position_controller_.reset(); |
307 | 312 |
308 // Delete the activation controller after other controllers and launcher | 313 // Delete the activation controller after other controllers and launcher |
309 // because they might have registered ActivationChangeObserver. | 314 // because they might have registered ActivationChangeObserver. |
310 activation_controller_.reset(); | 315 activation_controller_.reset(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 focus_client_.get(), | 467 focus_client_.get(), |
463 new internal::AshActivationController)); | 468 new internal::AshActivationController)); |
464 activation_client_ = activation_controller_.get(); | 469 activation_client_ = activation_controller_.get(); |
465 AddPreTargetHandler(activation_controller_.get()); | 470 AddPreTargetHandler(activation_controller_.get()); |
466 } | 471 } |
467 | 472 |
468 focus_cycler_.reset(new internal::FocusCycler()); | 473 focus_cycler_.reset(new internal::FocusCycler()); |
469 | 474 |
470 screen_position_controller_.reset(new internal::ScreenPositionController); | 475 screen_position_controller_.reset(new internal::ScreenPositionController); |
471 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); | 476 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); |
| 477 |
472 display_controller_->Start(); | 478 display_controller_->Start(); |
473 display_controller_->InitPrimaryDisplay(); | 479 display_controller_->InitPrimaryDisplay(); |
474 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); | 480 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); |
475 active_root_window_ = root_window; | 481 active_root_window_ = root_window; |
476 | 482 |
477 cursor_manager_.SetDisplay(DisplayController::GetPrimaryDisplay()); | 483 cursor_manager_.SetDisplay(DisplayController::GetPrimaryDisplay()); |
478 | 484 |
479 #if !defined(OS_MACOSX) | 485 #if !defined(OS_MACOSX) |
480 nested_dispatcher_controller_.reset(new NestedDispatcherController); | 486 nested_dispatcher_controller_.reset(new NestedDispatcherController); |
481 accelerator_controller_.reset(new AcceleratorController); | 487 accelerator_controller_.reset(new AcceleratorController); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 //////////////////////////////////////////////////////////////////////////////// | 953 //////////////////////////////////////////////////////////////////////////////// |
948 // Shell, aura::client::ActivationChangeObserver implementation: | 954 // Shell, aura::client::ActivationChangeObserver implementation: |
949 | 955 |
950 void Shell::OnWindowActivated(aura::Window* gained_active, | 956 void Shell::OnWindowActivated(aura::Window* gained_active, |
951 aura::Window* lost_active) { | 957 aura::Window* lost_active) { |
952 if (gained_active) | 958 if (gained_active) |
953 active_root_window_ = gained_active->GetRootWindow(); | 959 active_root_window_ = gained_active->GetRootWindow(); |
954 } | 960 } |
955 | 961 |
956 } // namespace ash | 962 } // namespace ash |
OLD | NEW |