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 12 matching lines...) Expand all Loading... |
23 #include "ash/display/event_transformation_handler.h" | 23 #include "ash/display/event_transformation_handler.h" |
24 #include "ash/display/mouse_cursor_event_filter.h" | 24 #include "ash/display/mouse_cursor_event_filter.h" |
25 #include "ash/display/screen_position_controller.h" | 25 #include "ash/display/screen_position_controller.h" |
26 #include "ash/display/virtual_keyboard_window_controller.h" | 26 #include "ash/display/virtual_keyboard_window_controller.h" |
27 #include "ash/drag_drop/drag_drop_controller.h" | 27 #include "ash/drag_drop/drag_drop_controller.h" |
28 #include "ash/first_run/first_run_helper_impl.h" | 28 #include "ash/first_run/first_run_helper_impl.h" |
29 #include "ash/focus_cycler.h" | 29 #include "ash/focus_cycler.h" |
30 #include "ash/frame/custom_frame_view_ash.h" | 30 #include "ash/frame/custom_frame_view_ash.h" |
31 #include "ash/gpu_support.h" | 31 #include "ash/gpu_support.h" |
32 #include "ash/high_contrast/high_contrast_controller.h" | 32 #include "ash/high_contrast/high_contrast_controller.h" |
33 #include "ash/host/window_tree_host_factory.h" | |
34 #include "ash/keyboard_uma_event_filter.h" | 33 #include "ash/keyboard_uma_event_filter.h" |
35 #include "ash/magnifier/magnification_controller.h" | 34 #include "ash/magnifier/magnification_controller.h" |
36 #include "ash/magnifier/partial_magnification_controller.h" | 35 #include "ash/magnifier/partial_magnification_controller.h" |
37 #include "ash/media_delegate.h" | 36 #include "ash/media_delegate.h" |
38 #include "ash/new_window_delegate.h" | 37 #include "ash/new_window_delegate.h" |
39 #include "ash/root_window_controller.h" | 38 #include "ash/root_window_controller.h" |
40 #include "ash/session_state_delegate.h" | 39 #include "ash/session_state_delegate.h" |
41 #include "ash/shelf/app_list_shelf_item_delegate.h" | 40 #include "ash/shelf/app_list_shelf_item_delegate.h" |
42 #include "ash/shelf/shelf_delegate.h" | 41 #include "ash/shelf/shelf_delegate.h" |
43 #include "ash/shelf/shelf_item_delegate.h" | 42 #include "ash/shelf/shelf_item_delegate.h" |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 AddPreTargetHandler(env_filter_.get()); | 830 AddPreTargetHandler(env_filter_.get()); |
832 | 831 |
833 ::wm::FocusController* focus_controller = | 832 ::wm::FocusController* focus_controller = |
834 new ::wm::FocusController(new wm::AshFocusRules); | 833 new ::wm::FocusController(new wm::AshFocusRules); |
835 focus_client_.reset(focus_controller); | 834 focus_client_.reset(focus_controller); |
836 activation_client_ = focus_controller; | 835 activation_client_ = focus_controller; |
837 activation_client_->AddObserver(this); | 836 activation_client_->AddObserver(this); |
838 focus_cycler_.reset(new FocusCycler()); | 837 focus_cycler_.reset(new FocusCycler()); |
839 | 838 |
840 screen_position_controller_.reset(new ScreenPositionController); | 839 screen_position_controller_.reset(new ScreenPositionController); |
841 window_tree_host_factory_.reset(delegate_->CreateWindowTreeHostFactory()); | |
842 | 840 |
843 display_controller_->Start(); | 841 display_controller_->Start(); |
844 display_controller_->InitPrimaryDisplay(); | 842 display_controller_->CreatePrimaryHost(); |
845 aura::Window* root_window = display_controller_->GetPrimaryRootWindow(); | 843 aura::Window* root_window = display_controller_->GetPrimaryRootWindow(); |
846 target_root_window_ = root_window; | 844 target_root_window_ = root_window; |
847 | 845 |
848 #if defined(OS_CHROMEOS) | 846 #if defined(OS_CHROMEOS) |
849 resolution_notification_controller_.reset( | 847 resolution_notification_controller_.reset( |
850 new ResolutionNotificationController); | 848 new ResolutionNotificationController); |
851 #endif | 849 #endif |
852 | 850 |
853 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); | 851 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); |
854 | 852 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 // Initialize system_tray_delegate_ after StatusAreaWidget is created. | 968 // Initialize system_tray_delegate_ after StatusAreaWidget is created. |
971 system_tray_delegate_->Initialize(); | 969 system_tray_delegate_->Initialize(); |
972 | 970 |
973 #if defined(OS_CHROMEOS) | 971 #if defined(OS_CHROMEOS) |
974 // Create the LogoutConfirmationController after the SystemTrayDelegate. | 972 // Create the LogoutConfirmationController after the SystemTrayDelegate. |
975 logout_confirmation_controller_.reset(new LogoutConfirmationController( | 973 logout_confirmation_controller_.reset(new LogoutConfirmationController( |
976 base::Bind(&SystemTrayDelegate::SignOut, | 974 base::Bind(&SystemTrayDelegate::SignOut, |
977 base::Unretained(system_tray_delegate_.get())))); | 975 base::Unretained(system_tray_delegate_.get())))); |
978 #endif | 976 #endif |
979 | 977 |
980 // TODO(oshima): Initialize all RootWindowControllers once, and | 978 display_controller_->InitDisplays(); |
981 // initialize controller/delegates above when initializing the | |
982 // primary root window controller. | |
983 RootWindowController::CreateForPrimaryDisplay(root_window->GetHost()); | |
984 | |
985 display_controller_->InitSecondaryDisplays(); | |
986 | 979 |
987 // It needs to be created after RootWindowController has been created | 980 // It needs to be created after RootWindowController has been created |
988 // (which calls OnWindowResized has been called, otherwise the | 981 // (which calls OnWindowResized has been called, otherwise the |
989 // widget will not paint when restoring after a browser crash. Also it needs | 982 // widget will not paint when restoring after a browser crash. Also it needs |
990 // to be created after InitSecondaryDisplays() to initialize the wallpapers in | 983 // to be created after InitSecondaryDisplays() to initialize the wallpapers in |
991 // the correct size. | 984 // the correct size. |
992 user_wallpaper_delegate_->InitializeWallpaper(); | 985 user_wallpaper_delegate_->InitializeWallpaper(); |
993 | 986 |
994 if (initially_hide_cursor_) | 987 if (initially_hide_cursor_) |
995 cursor_manager_.HideCursor(); | 988 cursor_manager_.HideCursor(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 //////////////////////////////////////////////////////////////////////////////// | 1104 //////////////////////////////////////////////////////////////////////////////// |
1112 // Shell, aura::client::ActivationChangeObserver implementation: | 1105 // Shell, aura::client::ActivationChangeObserver implementation: |
1113 | 1106 |
1114 void Shell::OnWindowActivated(aura::Window* gained_active, | 1107 void Shell::OnWindowActivated(aura::Window* gained_active, |
1115 aura::Window* lost_active) { | 1108 aura::Window* lost_active) { |
1116 if (gained_active) | 1109 if (gained_active) |
1117 target_root_window_ = gained_active->GetRootWindow(); | 1110 target_root_window_ = gained_active->GetRootWindow(); |
1118 } | 1111 } |
1119 | 1112 |
1120 } // namespace ash | 1113 } // namespace ash |
OLD | NEW |