Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: ash/shell.cc

Issue 2932563002: Implement cursor changing on Mushrome (Closed)
Patch Set: Remove last NOTIMPLEMENTED for this patch Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 #include "ash/system/tray/system_tray_controller.h" 85 #include "ash/system/tray/system_tray_controller.h"
86 #include "ash/system/tray/system_tray_delegate.h" 86 #include "ash/system/tray/system_tray_delegate.h"
87 #include "ash/system/tray/system_tray_notifier.h" 87 #include "ash/system/tray/system_tray_notifier.h"
88 #include "ash/touch/ash_touch_transform_controller.h" 88 #include "ash/touch/ash_touch_transform_controller.h"
89 #include "ash/tray_action/tray_action.h" 89 #include "ash/tray_action/tray_action.h"
90 #include "ash/utility/screenshot_controller.h" 90 #include "ash/utility/screenshot_controller.h"
91 #include "ash/virtual_keyboard_controller.h" 91 #include "ash/virtual_keyboard_controller.h"
92 #include "ash/wallpaper/wallpaper_controller.h" 92 #include "ash/wallpaper/wallpaper_controller.h"
93 #include "ash/wallpaper/wallpaper_delegate.h" 93 #include "ash/wallpaper/wallpaper_delegate.h"
94 #include "ash/wm/ash_focus_rules.h" 94 #include "ash/wm/ash_focus_rules.h"
95 #include "ash/wm/ash_native_cursor_manager.h" 95 #include "ash/wm/classic_ash_native_cursor_manager.h"
96 #include "ash/wm/container_finder.h" 96 #include "ash/wm/container_finder.h"
97 #include "ash/wm/event_client_impl.h" 97 #include "ash/wm/event_client_impl.h"
98 #include "ash/wm/immersive_context_ash.h" 98 #include "ash/wm/immersive_context_ash.h"
99 #include "ash/wm/immersive_handler_factory_ash.h" 99 #include "ash/wm/immersive_handler_factory_ash.h"
100 #include "ash/wm/lock_state_controller.h" 100 #include "ash/wm/lock_state_controller.h"
101 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 101 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
102 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" 102 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h"
103 #include "ash/wm/mru_window_tracker.h" 103 #include "ash/wm/mru_window_tracker.h"
104 #include "ash/wm/mushrome_ash_native_cursor_manager.h"
104 #include "ash/wm/overlay_event_filter.h" 105 #include "ash/wm/overlay_event_filter.h"
105 #include "ash/wm/overview/window_selector_controller.h" 106 #include "ash/wm/overview/window_selector_controller.h"
106 #include "ash/wm/power_button_controller.h" 107 #include "ash/wm/power_button_controller.h"
107 #include "ash/wm/resize_shadow_controller.h" 108 #include "ash/wm/resize_shadow_controller.h"
108 #include "ash/wm/root_window_finder.h" 109 #include "ash/wm/root_window_finder.h"
109 #include "ash/wm/screen_pinning_controller.h" 110 #include "ash/wm/screen_pinning_controller.h"
110 #include "ash/wm/system_gesture_event_filter.h" 111 #include "ash/wm/system_gesture_event_filter.h"
111 #include "ash/wm/system_modal_container_event_filter.h" 112 #include "ash/wm/system_modal_container_event_filter.h"
112 #include "ash/wm/system_modal_container_layout_manager.h" 113 #include "ash/wm/system_modal_container_layout_manager.h"
113 #include "ash/wm/toplevel_window_event_handler.h" 114 #include "ash/wm/toplevel_window_event_handler.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 FirstRunHelper* Shell::CreateFirstRunHelper() { 431 FirstRunHelper* Shell::CreateFirstRunHelper() {
431 return new FirstRunHelperImpl; 432 return new FirstRunHelperImpl;
432 } 433 }
433 434
434 void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) { 435 void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) {
435 window_tree_host_manager_->cursor_window_controller() 436 window_tree_host_manager_->cursor_window_controller()
436 ->SetLargeCursorSizeInDip(large_cursor_size_in_dip); 437 ->SetLargeCursorSizeInDip(large_cursor_size_in_dip);
437 } 438 }
438 439
439 void Shell::SetCursorCompositingEnabled(bool enabled) { 440 void Shell::SetCursorCompositingEnabled(bool enabled) {
440 if (GetAshConfig() == Config::CLASSIC) { 441 if (GetAshConfig() != Config::MASH) {
441 // TODO: needs to work in mus. http://crbug.com/705592. 442 // TODO: needs to work in mus. http://crbug.com/705592.
James Cook 2017/06/12 20:17:24 Comment still relevant? Should "mus" be "mash"?
Elliot Glaysher 2017/06/12 23:18:46 Done.
442 window_tree_host_manager_->cursor_window_controller() 443 window_tree_host_manager_->cursor_window_controller()
443 ->SetCursorCompositingEnabled(enabled); 444 ->SetCursorCompositingEnabled(enabled);
444 native_cursor_manager_->SetNativeCursorEnabled(!enabled); 445 native_cursor_manager_->SetNativeCursorEnabled(!enabled);
445 } 446 }
446 } 447 }
447 448
448 void Shell::DoInitialWorkspaceAnimation() { 449 void Shell::DoInitialWorkspaceAnimation() {
449 return GetPrimaryRootWindowController() 450 return GetPrimaryRootWindowController()
450 ->workspace_controller() 451 ->workspace_controller()
451 ->DoInitialAnimation(); 452 ->DoInitialAnimation();
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 if (config == Config::MASH) 851 if (config == Config::MASH)
851 app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>(); 852 app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>();
852 853
853 // TODO(sky): move creation to ShellPort. 854 // TODO(sky): move creation to ShellPort.
854 if (config != Config::MASH) 855 if (config != Config::MASH)
855 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>(); 856 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>();
856 857
857 window_positioner_ = base::MakeUnique<WindowPositioner>(); 858 window_positioner_ = base::MakeUnique<WindowPositioner>();
858 859
859 if (config == Config::CLASSIC) { 860 if (config == Config::CLASSIC) {
860 // TODO: needs to work in mus. http://crbug.com/705592. 861 // TODO: needs to work in mus. http://crbug.com/705592.
James Cook 2017/06/12 20:17:24 ditto
Elliot Glaysher 2017/06/12 23:18:46 Done.
861 native_cursor_manager_ = new AshNativeCursorManager; 862 native_cursor_manager_ = new ClassicAshNativeCursorManager;
863 cursor_manager_.reset(
James Cook 2017/06/12 20:17:24 nit: base::MakeUnique<>
Elliot Glaysher 2017/06/12 23:18:46 Done.
864 new CursorManager(base::WrapUnique(native_cursor_manager_)));
865 } else if (config == Config::MUS) {
866 native_cursor_manager_ = new MushromeAshNativeCursorManager;
862 cursor_manager_.reset( 867 cursor_manager_.reset(
863 new CursorManager(base::WrapUnique(native_cursor_manager_))); 868 new CursorManager(base::WrapUnique(native_cursor_manager_)));
864 } 869 }
865 870
866 shell_delegate_->PreInit(); 871 shell_delegate_->PreInit();
867 bool display_initialized = (!ShouldEnableSimplifiedDisplayManagement() || 872 bool display_initialized = (!ShouldEnableSimplifiedDisplayManagement() ||
868 display_manager_->InitFromCommandLine()); 873 display_manager_->InitFromCommandLine());
869 if (!display_initialized && config != Config::CLASSIC && 874 if (!display_initialized && config != Config::CLASSIC &&
870 ShouldEnableSimplifiedDisplayManagement()) { 875 ShouldEnableSimplifiedDisplayManagement()) {
871 // Run display configuration off device in mus mode. 876 // Run display configuration off device in mus mode.
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 void Shell::OnPrefServiceInitialized( 1282 void Shell::OnPrefServiceInitialized(
1278 std::unique_ptr<::PrefService> pref_service) { 1283 std::unique_ptr<::PrefService> pref_service) {
1279 if (!instance_) 1284 if (!instance_)
1280 return; 1285 return;
1281 // |pref_service_| is null if can't connect to Chrome (as happens when 1286 // |pref_service_| is null if can't connect to Chrome (as happens when
1282 // running mash outside of chrome --mash and chrome isn't built). 1287 // running mash outside of chrome --mash and chrome isn't built).
1283 pref_service_ = std::move(pref_service); 1288 pref_service_ = std::move(pref_service);
1284 } 1289 }
1285 1290
1286 } // namespace ash 1291 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698