| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 FirstRunHelper* Shell::CreateFirstRunHelper() { | 447 FirstRunHelper* Shell::CreateFirstRunHelper() { |
| 447 return new FirstRunHelperImpl; | 448 return new FirstRunHelperImpl; |
| 448 } | 449 } |
| 449 | 450 |
| 450 void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) { | 451 void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) { |
| 451 window_tree_host_manager_->cursor_window_controller() | 452 window_tree_host_manager_->cursor_window_controller() |
| 452 ->SetLargeCursorSizeInDip(large_cursor_size_in_dip); | 453 ->SetLargeCursorSizeInDip(large_cursor_size_in_dip); |
| 453 } | 454 } |
| 454 | 455 |
| 455 void Shell::SetCursorCompositingEnabled(bool enabled) { | 456 void Shell::SetCursorCompositingEnabled(bool enabled) { |
| 456 if (GetAshConfig() == Config::CLASSIC) { | 457 if (GetAshConfig() != Config::MASH) { |
| 457 // TODO: needs to work in mus. http://crbug.com/705592. | 458 // TODO: needs to work in mash. http://crbug.com/705592. |
| 458 window_tree_host_manager_->cursor_window_controller() | 459 window_tree_host_manager_->cursor_window_controller() |
| 459 ->SetCursorCompositingEnabled(enabled); | 460 ->SetCursorCompositingEnabled(enabled); |
| 460 native_cursor_manager_->SetNativeCursorEnabled(!enabled); | 461 native_cursor_manager_->SetNativeCursorEnabled(!enabled); |
| 461 } | 462 } |
| 462 } | 463 } |
| 463 | 464 |
| 464 void Shell::DoInitialWorkspaceAnimation() { | 465 void Shell::DoInitialWorkspaceAnimation() { |
| 465 return GetPrimaryRootWindowController() | 466 return GetPrimaryRootWindowController() |
| 466 ->workspace_controller() | 467 ->workspace_controller() |
| 467 ->DoInitialAnimation(); | 468 ->DoInitialAnimation(); |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 if (config == Config::MASH) | 872 if (config == Config::MASH) |
| 872 app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>(); | 873 app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>(); |
| 873 | 874 |
| 874 // TODO(sky): move creation to ShellPort. | 875 // TODO(sky): move creation to ShellPort. |
| 875 if (config != Config::MASH) | 876 if (config != Config::MASH) |
| 876 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>(); | 877 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>(); |
| 877 | 878 |
| 878 window_positioner_ = base::MakeUnique<WindowPositioner>(); | 879 window_positioner_ = base::MakeUnique<WindowPositioner>(); |
| 879 | 880 |
| 880 if (config == Config::CLASSIC) { | 881 if (config == Config::CLASSIC) { |
| 881 // TODO: needs to work in mus. http://crbug.com/705592. | 882 native_cursor_manager_ = new NativeCursorManagerAshClassic; |
| 882 native_cursor_manager_ = new AshNativeCursorManager; | 883 cursor_manager_ = base::MakeUnique<CursorManager>( |
| 883 cursor_manager_.reset( | 884 base::WrapUnique(native_cursor_manager_)); |
| 884 new CursorManager(base::WrapUnique(native_cursor_manager_))); | 885 } else if (config == Config::MUS) { |
| 886 native_cursor_manager_ = new NativeCursorManagerAshMus; |
| 887 cursor_manager_ = base::MakeUnique<CursorManager>( |
| 888 base::WrapUnique(native_cursor_manager_)); |
| 885 } | 889 } |
| 886 | 890 |
| 887 shell_delegate_->PreInit(); | 891 shell_delegate_->PreInit(); |
| 888 bool display_initialized = (!ShouldEnableSimplifiedDisplayManagement() || | 892 bool display_initialized = (!ShouldEnableSimplifiedDisplayManagement() || |
| 889 display_manager_->InitFromCommandLine()); | 893 display_manager_->InitFromCommandLine()); |
| 890 if (!display_initialized && config != Config::CLASSIC && | 894 if (!display_initialized && config != Config::CLASSIC && |
| 891 ShouldEnableSimplifiedDisplayManagement()) { | 895 ShouldEnableSimplifiedDisplayManagement()) { |
| 892 // Run display configuration off device in mus mode. | 896 // Run display configuration off device in mus mode. |
| 893 display_manager_->set_configure_displays(true); | 897 display_manager_->set_configure_displays(true); |
| 894 display_configurator_->set_configure_display(true); | 898 display_configurator_->set_configure_display(true); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 void Shell::OnPrefServiceInitialized( | 1291 void Shell::OnPrefServiceInitialized( |
| 1288 std::unique_ptr<::PrefService> pref_service) { | 1292 std::unique_ptr<::PrefService> pref_service) { |
| 1289 if (!instance_) | 1293 if (!instance_) |
| 1290 return; | 1294 return; |
| 1291 // |pref_service_| is null if can't connect to Chrome (as happens when | 1295 // |pref_service_| is null if can't connect to Chrome (as happens when |
| 1292 // running mash outside of chrome --mash and chrome isn't built). | 1296 // running mash outside of chrome --mash and chrome isn't built). |
| 1293 pref_service_ = std::move(pref_service); | 1297 pref_service_ = std::move(pref_service); |
| 1294 } | 1298 } |
| 1295 | 1299 |
| 1296 } // namespace ash | 1300 } // namespace ash |
| OLD | NEW |