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 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #include "ash/system/tray/system_tray_controller.h" | 86 #include "ash/system/tray/system_tray_controller.h" |
87 #include "ash/system/tray/system_tray_delegate.h" | 87 #include "ash/system/tray/system_tray_delegate.h" |
88 #include "ash/system/tray/system_tray_notifier.h" | 88 #include "ash/system/tray/system_tray_notifier.h" |
89 #include "ash/touch/ash_touch_transform_controller.h" | 89 #include "ash/touch/ash_touch_transform_controller.h" |
90 #include "ash/tray_action/tray_action.h" | 90 #include "ash/tray_action/tray_action.h" |
91 #include "ash/utility/screenshot_controller.h" | 91 #include "ash/utility/screenshot_controller.h" |
92 #include "ash/virtual_keyboard_controller.h" | 92 #include "ash/virtual_keyboard_controller.h" |
93 #include "ash/wallpaper/wallpaper_controller.h" | 93 #include "ash/wallpaper/wallpaper_controller.h" |
94 #include "ash/wallpaper/wallpaper_delegate.h" | 94 #include "ash/wallpaper/wallpaper_delegate.h" |
95 #include "ash/wm/ash_focus_rules.h" | 95 #include "ash/wm/ash_focus_rules.h" |
96 #include "ash/wm/ash_native_cursor_manager.h" | |
97 #include "ash/wm/container_finder.h" | 96 #include "ash/wm/container_finder.h" |
98 #include "ash/wm/event_client_impl.h" | 97 #include "ash/wm/event_client_impl.h" |
99 #include "ash/wm/immersive_context_ash.h" | 98 #include "ash/wm/immersive_context_ash.h" |
100 #include "ash/wm/immersive_handler_factory_ash.h" | 99 #include "ash/wm/immersive_handler_factory_ash.h" |
101 #include "ash/wm/lock_state_controller.h" | 100 #include "ash/wm/lock_state_controller.h" |
102 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 101 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
103 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" | 102 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" |
104 #include "ash/wm/mru_window_tracker.h" | 103 #include "ash/wm/mru_window_tracker.h" |
| 104 #include "ash/wm/native_cursor_manager_ash_classic.h" |
| 105 #include "ash/wm/native_cursor_manager_ash_mus.h" |
105 #include "ash/wm/overlay_event_filter.h" | 106 #include "ash/wm/overlay_event_filter.h" |
106 #include "ash/wm/overview/window_selector_controller.h" | 107 #include "ash/wm/overview/window_selector_controller.h" |
107 #include "ash/wm/power_button_controller.h" | 108 #include "ash/wm/power_button_controller.h" |
108 #include "ash/wm/resize_shadow_controller.h" | 109 #include "ash/wm/resize_shadow_controller.h" |
109 #include "ash/wm/root_window_finder.h" | 110 #include "ash/wm/root_window_finder.h" |
110 #include "ash/wm/screen_pinning_controller.h" | 111 #include "ash/wm/screen_pinning_controller.h" |
111 #include "ash/wm/system_gesture_event_filter.h" | 112 #include "ash/wm/system_gesture_event_filter.h" |
112 #include "ash/wm/system_modal_container_event_filter.h" | 113 #include "ash/wm/system_modal_container_event_filter.h" |
113 #include "ash/wm/system_modal_container_layout_manager.h" | 114 #include "ash/wm/system_modal_container_layout_manager.h" |
114 #include "ash/wm/toplevel_window_event_handler.h" | 115 #include "ash/wm/toplevel_window_event_handler.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 FirstRunHelper* Shell::CreateFirstRunHelper() { | 432 FirstRunHelper* Shell::CreateFirstRunHelper() { |
432 return new FirstRunHelperImpl; | 433 return new FirstRunHelperImpl; |
433 } | 434 } |
434 | 435 |
435 void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) { | 436 void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) { |
436 window_tree_host_manager_->cursor_window_controller() | 437 window_tree_host_manager_->cursor_window_controller() |
437 ->SetLargeCursorSizeInDip(large_cursor_size_in_dip); | 438 ->SetLargeCursorSizeInDip(large_cursor_size_in_dip); |
438 } | 439 } |
439 | 440 |
440 void Shell::SetCursorCompositingEnabled(bool enabled) { | 441 void Shell::SetCursorCompositingEnabled(bool enabled) { |
441 if (GetAshConfig() == Config::CLASSIC) { | 442 if (GetAshConfig() != Config::MASH) { |
442 // TODO: needs to work in mus. http://crbug.com/705592. | 443 // TODO: needs to work in mash. http://crbug.com/705592. |
443 window_tree_host_manager_->cursor_window_controller() | 444 window_tree_host_manager_->cursor_window_controller() |
444 ->SetCursorCompositingEnabled(enabled); | 445 ->SetCursorCompositingEnabled(enabled); |
445 native_cursor_manager_->SetNativeCursorEnabled(!enabled); | 446 native_cursor_manager_->SetNativeCursorEnabled(!enabled); |
446 } | 447 } |
447 } | 448 } |
448 | 449 |
449 void Shell::DoInitialWorkspaceAnimation() { | 450 void Shell::DoInitialWorkspaceAnimation() { |
450 return GetPrimaryRootWindowController() | 451 return GetPrimaryRootWindowController() |
451 ->workspace_controller() | 452 ->workspace_controller() |
452 ->DoInitialAnimation(); | 453 ->DoInitialAnimation(); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 if (config == Config::MASH) | 860 if (config == Config::MASH) |
860 app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>(); | 861 app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>(); |
861 | 862 |
862 // TODO(sky): move creation to ShellPort. | 863 // TODO(sky): move creation to ShellPort. |
863 if (config != Config::MASH) | 864 if (config != Config::MASH) |
864 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>(); | 865 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>(); |
865 | 866 |
866 window_positioner_ = base::MakeUnique<WindowPositioner>(); | 867 window_positioner_ = base::MakeUnique<WindowPositioner>(); |
867 | 868 |
868 if (config == Config::CLASSIC) { | 869 if (config == Config::CLASSIC) { |
869 // TODO: needs to work in mus. http://crbug.com/705592. | 870 native_cursor_manager_ = new NativeCursorManagerAshClassic; |
870 native_cursor_manager_ = new AshNativeCursorManager; | 871 cursor_manager_ = base::MakeUnique<CursorManager>( |
871 cursor_manager_.reset( | 872 base::WrapUnique(native_cursor_manager_)); |
872 new CursorManager(base::WrapUnique(native_cursor_manager_))); | 873 } else if (config == Config::MUS) { |
| 874 native_cursor_manager_ = new NativeCursorManagerAshMus; |
| 875 cursor_manager_ = base::MakeUnique<CursorManager>( |
| 876 base::WrapUnique(native_cursor_manager_)); |
873 } | 877 } |
874 | 878 |
875 shell_delegate_->PreInit(); | 879 shell_delegate_->PreInit(); |
876 bool display_initialized = (!ShouldEnableSimplifiedDisplayManagement() || | 880 bool display_initialized = (!ShouldEnableSimplifiedDisplayManagement() || |
877 display_manager_->InitFromCommandLine()); | 881 display_manager_->InitFromCommandLine()); |
878 if (!display_initialized && config != Config::CLASSIC && | 882 if (!display_initialized && config != Config::CLASSIC && |
879 ShouldEnableSimplifiedDisplayManagement()) { | 883 ShouldEnableSimplifiedDisplayManagement()) { |
880 // Run display configuration off device in mus mode. | 884 // Run display configuration off device in mus mode. |
881 display_manager_->set_configure_displays(true); | 885 display_manager_->set_configure_displays(true); |
882 display_configurator_->set_configure_display(true); | 886 display_configurator_->set_configure_display(true); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 void Shell::OnPrefServiceInitialized( | 1288 void Shell::OnPrefServiceInitialized( |
1285 std::unique_ptr<::PrefService> pref_service) { | 1289 std::unique_ptr<::PrefService> pref_service) { |
1286 if (!instance_) | 1290 if (!instance_) |
1287 return; | 1291 return; |
1288 // |pref_service_| is null if can't connect to Chrome (as happens when | 1292 // |pref_service_| is null if can't connect to Chrome (as happens when |
1289 // running mash outside of chrome --mash and chrome isn't built). | 1293 // running mash outside of chrome --mash and chrome isn't built). |
1290 pref_service_ = std::move(pref_service); | 1294 pref_service_ = std::move(pref_service); |
1291 } | 1295 } |
1292 | 1296 |
1293 } // namespace ash | 1297 } // namespace ash |
OLD | NEW |