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" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "ash/wm/ash_focus_rules.h" | 43 #include "ash/wm/ash_focus_rules.h" |
44 #include "ash/wm/ash_native_cursor_manager.h" | 44 #include "ash/wm/ash_native_cursor_manager.h" |
45 #include "ash/wm/base_layout_manager.h" | 45 #include "ash/wm/base_layout_manager.h" |
46 #include "ash/wm/capture_controller.h" | 46 #include "ash/wm/capture_controller.h" |
47 #include "ash/wm/coordinate_conversion.h" | 47 #include "ash/wm/coordinate_conversion.h" |
48 #include "ash/wm/custom_frame_view_ash.h" | 48 #include "ash/wm/custom_frame_view_ash.h" |
49 #include "ash/wm/event_client_impl.h" | 49 #include "ash/wm/event_client_impl.h" |
50 #include "ash/wm/event_rewriter_event_filter.h" | 50 #include "ash/wm/event_rewriter_event_filter.h" |
51 #include "ash/wm/lock_state_controller.h" | 51 #include "ash/wm/lock_state_controller.h" |
52 #include "ash/wm/lock_state_controller_impl2.h" | 52 #include "ash/wm/lock_state_controller_impl2.h" |
| 53 #include "ash/wm/mru_window_tracker.h" |
53 #include "ash/wm/overlay_event_filter.h" | 54 #include "ash/wm/overlay_event_filter.h" |
54 #include "ash/wm/power_button_controller.h" | 55 #include "ash/wm/power_button_controller.h" |
55 #include "ash/wm/property_util.h" | 56 #include "ash/wm/property_util.h" |
56 #include "ash/wm/resize_shadow_controller.h" | 57 #include "ash/wm/resize_shadow_controller.h" |
57 #include "ash/wm/root_window_layout_manager.h" | 58 #include "ash/wm/root_window_layout_manager.h" |
58 #include "ash/wm/screen_dimmer.h" | 59 #include "ash/wm/screen_dimmer.h" |
59 #include "ash/wm/session_state_controller_impl.h" | 60 #include "ash/wm/session_state_controller_impl.h" |
60 #include "ash/wm/system_gesture_event_filter.h" | 61 #include "ash/wm/system_gesture_event_filter.h" |
61 #include "ash/wm/system_modal_container_event_filter.h" | 62 #include "ash/wm/system_modal_container_event_filter.h" |
62 #include "ash/wm/system_modal_container_layout_manager.h" | 63 #include "ash/wm/system_modal_container_layout_manager.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 capture_controller_.reset(); | 298 capture_controller_.reset(); |
298 nested_dispatcher_controller_.reset(); | 299 nested_dispatcher_controller_.reset(); |
299 user_action_client_.reset(); | 300 user_action_client_.reset(); |
300 visibility_controller_.reset(); | 301 visibility_controller_.reset(); |
301 launcher_delegate_.reset(); | 302 launcher_delegate_.reset(); |
302 launcher_model_.reset(); | 303 launcher_model_.reset(); |
303 video_detector_.reset(); | 304 video_detector_.reset(); |
304 | 305 |
305 power_button_controller_.reset(); | 306 power_button_controller_.reset(); |
306 lock_state_controller_.reset(); | 307 lock_state_controller_.reset(); |
| 308 mru_window_tracker_.reset(); |
307 | 309 |
308 // This also deletes all RootWindows. Note that we invoke Shutdown() on | 310 // This also deletes all RootWindows. Note that we invoke Shutdown() on |
309 // DisplayController before resetting |display_controller_|, since destruction | 311 // DisplayController before resetting |display_controller_|, since destruction |
310 // of its owned RootWindowControllers relies on the value. | 312 // of its owned RootWindowControllers relies on the value. |
311 display_controller_->Shutdown(); | 313 display_controller_->Shutdown(); |
312 display_controller_.reset(); | 314 display_controller_.reset(); |
313 screen_position_controller_.reset(); | 315 screen_position_controller_.reset(); |
314 | 316 |
315 // Delete the activation controller after other controllers and launcher | 317 // Delete the activation controller after other controllers and launcher |
316 // because they might have registered ActivationChangeObserver. | 318 // because they might have registered ActivationChangeObserver. |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 // TODO(oshima): Move as many controllers before creating | 554 // TODO(oshima): Move as many controllers before creating |
553 // RootWindowController as possible. | 555 // RootWindowController as possible. |
554 visibility_controller_.reset(new AshVisibilityController); | 556 visibility_controller_.reset(new AshVisibilityController); |
555 user_action_client_.reset(delegate_->CreateUserActionClient()); | 557 user_action_client_.reset(delegate_->CreateUserActionClient()); |
556 window_modality_controller_.reset( | 558 window_modality_controller_.reset( |
557 new views::corewm::WindowModalityController); | 559 new views::corewm::WindowModalityController); |
558 AddPreTargetHandler(window_modality_controller_.get()); | 560 AddPreTargetHandler(window_modality_controller_.get()); |
559 | 561 |
560 magnification_controller_.reset( | 562 magnification_controller_.reset( |
561 MagnificationController::CreateInstance()); | 563 MagnificationController::CreateInstance()); |
| 564 mru_window_tracker_.reset(new MruWindowTracker(activation_client_)); |
562 | 565 |
563 partial_magnification_controller_.reset( | 566 partial_magnification_controller_.reset( |
564 new PartialMagnificationController()); | 567 new PartialMagnificationController()); |
565 | 568 |
566 high_contrast_controller_.reset(new HighContrastController); | 569 high_contrast_controller_.reset(new HighContrastController); |
567 video_detector_.reset(new VideoDetector); | 570 video_detector_.reset(new VideoDetector); |
568 window_cycle_controller_.reset(new WindowCycleController(activation_client_)); | 571 window_cycle_controller_.reset(new WindowCycleController()); |
569 | 572 |
570 tooltip_controller_.reset(new views::corewm::TooltipController( | 573 tooltip_controller_.reset(new views::corewm::TooltipController( |
571 gfx::SCREEN_TYPE_ALTERNATE)); | 574 gfx::SCREEN_TYPE_ALTERNATE)); |
572 AddPreTargetHandler(tooltip_controller_.get()); | 575 AddPreTargetHandler(tooltip_controller_.get()); |
573 | 576 |
574 event_client_.reset(new internal::EventClientImpl); | 577 event_client_.reset(new internal::EventClientImpl); |
575 | 578 |
576 // This controller needs to be set before SetupManagedWindowMode. | 579 // This controller needs to be set before SetupManagedWindowMode. |
577 desktop_background_controller_.reset(new DesktopBackgroundController()); | 580 desktop_background_controller_.reset(new DesktopBackgroundController()); |
578 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); | 581 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 917 |
915 if (nested_dispatcher_controller_) { | 918 if (nested_dispatcher_controller_) { |
916 aura::client::SetDispatcherClient(root_window, | 919 aura::client::SetDispatcherClient(root_window, |
917 nested_dispatcher_controller_.get()); | 920 nested_dispatcher_controller_.get()); |
918 } | 921 } |
919 if (user_action_client_) | 922 if (user_action_client_) |
920 aura::client::SetUserActionClient(root_window, user_action_client_.get()); | 923 aura::client::SetUserActionClient(root_window, user_action_client_.get()); |
921 | 924 |
922 controller->Init(first_run_after_boot); | 925 controller->Init(first_run_after_boot); |
923 | 926 |
924 window_cycle_controller_->OnRootWindowAdded(root_window); | 927 mru_window_tracker_->OnRootWindowAdded(root_window); |
925 } | 928 } |
926 | 929 |
927 //////////////////////////////////////////////////////////////////////////////// | 930 //////////////////////////////////////////////////////////////////////////////// |
928 // Shell, private: | 931 // Shell, private: |
929 | 932 |
930 bool Shell::CanWindowReceiveEvents(aura::Window* window) { | 933 bool Shell::CanWindowReceiveEvents(aura::Window* window) { |
931 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 934 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
932 for (RootWindowControllerList::iterator iter = controllers.begin(); | 935 for (RootWindowControllerList::iterator iter = controllers.begin(); |
933 iter != controllers.end(); ++iter) { | 936 iter != controllers.end(); ++iter) { |
934 internal::SystemModalContainerLayoutManager* layout_manager = | 937 internal::SystemModalContainerLayoutManager* layout_manager = |
(...skipping 21 matching lines...) Expand all Loading... |
956 //////////////////////////////////////////////////////////////////////////////// | 959 //////////////////////////////////////////////////////////////////////////////// |
957 // Shell, aura::client::ActivationChangeObserver implementation: | 960 // Shell, aura::client::ActivationChangeObserver implementation: |
958 | 961 |
959 void Shell::OnWindowActivated(aura::Window* gained_active, | 962 void Shell::OnWindowActivated(aura::Window* gained_active, |
960 aura::Window* lost_active) { | 963 aura::Window* lost_active) { |
961 if (gained_active) | 964 if (gained_active) |
962 active_root_window_ = gained_active->GetRootWindow(); | 965 active_root_window_ = gained_active->GetRootWindow(); |
963 } | 966 } |
964 | 967 |
965 } // namespace ash | 968 } // namespace ash |
OLD | NEW |