OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus/bridge/wm_shell_mus.h" | 5 #include "ash/mus/bridge/wm_shell_mus.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
10 #include "ash/common/display/display_info.h" | 10 #include "ash/common/display/display_info.h" |
11 #include "ash/common/keyboard/keyboard_ui.h" | 11 #include "ash/common/keyboard/keyboard_ui.h" |
12 #include "ash/common/session/session_state_delegate.h" | 12 #include "ash/common/session/session_state_delegate.h" |
13 #include "ash/common/shell_delegate.h" | 13 #include "ash/common/shell_delegate.h" |
14 #include "ash/common/shell_observer.h" | 14 #include "ash/common/shell_observer.h" |
15 #include "ash/common/shell_window_ids.h" | 15 #include "ash/common/shell_window_ids.h" |
16 #include "ash/common/system/tray/default_system_tray_delegate.h" | 16 #include "ash/common/system/tray/default_system_tray_delegate.h" |
17 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" | 17 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" |
18 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard
.h" | 18 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard
.h" |
19 #include "ash/common/wm/mru_window_tracker.h" | 19 #include "ash/common/wm/mru_window_tracker.h" |
20 #include "ash/common/wm/window_cycle_event_filter.h" | 20 #include "ash/common/wm/window_cycle_event_filter.h" |
21 #include "ash/common/wm/window_resizer.h" | 21 #include "ash/common/wm/window_resizer.h" |
22 #include "ash/common/wm_activation_observer.h" | 22 #include "ash/common/wm_activation_observer.h" |
23 #include "ash/mus/accelerators/accelerator_controller_delegate_mus.h" | 23 #include "ash/mus/accelerators/accelerator_controller_delegate_mus.h" |
24 #include "ash/mus/accelerators/accelerator_controller_registrar.h" | 24 #include "ash/mus/accelerators/accelerator_controller_registrar.h" |
| 25 #include "ash/mus/bridge/immersive_handler_factory_mus.h" |
25 #include "ash/mus/bridge/wm_root_window_controller_mus.h" | 26 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
26 #include "ash/mus/bridge/wm_window_mus.h" | 27 #include "ash/mus/bridge/wm_window_mus.h" |
27 #include "ash/mus/container_ids.h" | 28 #include "ash/mus/container_ids.h" |
28 #include "ash/mus/drag_window_resizer.h" | 29 #include "ash/mus/drag_window_resizer.h" |
29 #include "ash/mus/root_window_controller.h" | 30 #include "ash/mus/root_window_controller.h" |
30 #include "ash/mus/window_manager.h" | 31 #include "ash/mus/window_manager.h" |
31 #include "ash/shared/immersive_fullscreen_controller.h" | 32 #include "ash/shared/immersive_fullscreen_controller.h" |
32 #include "base/memory/ptr_util.h" | 33 #include "base/memory/ptr_util.h" |
33 #include "components/user_manager/user_info_impl.h" | 34 #include "components/user_manager/user_info_impl.h" |
34 #include "services/ui/common/util.h" | 35 #include "services/ui/common/util.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 const bool add_result = | 119 const bool add_result = |
119 window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id); | 120 window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id); |
120 // WmShellMus is created early on, so that this should always succeed. | 121 // WmShellMus is created early on, so that this should always succeed. |
121 DCHECK(add_result); | 122 DCHECK(add_result); |
122 accelerator_controller_delegate_.reset(new AcceleratorControllerDelegateMus); | 123 accelerator_controller_delegate_.reset(new AcceleratorControllerDelegateMus); |
123 accelerator_controller_registrar_.reset(new AcceleratorControllerRegistrar( | 124 accelerator_controller_registrar_.reset(new AcceleratorControllerRegistrar( |
124 window_manager_, accelerator_namespace_id)); | 125 window_manager_, accelerator_namespace_id)); |
125 SetAcceleratorController(base::MakeUnique<AcceleratorController>( | 126 SetAcceleratorController(base::MakeUnique<AcceleratorController>( |
126 accelerator_controller_delegate_.get(), | 127 accelerator_controller_delegate_.get(), |
127 accelerator_controller_registrar_.get())); | 128 accelerator_controller_registrar_.get())); |
| 129 immersive_handler_factory_.reset(new ImmersiveHandlerFactoryMus); |
128 | 130 |
129 CreateMaximizeModeController(); | 131 CreateMaximizeModeController(); |
130 | 132 |
131 CreateMruWindowTracker(); | 133 CreateMruWindowTracker(); |
132 | 134 |
133 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); | 135 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); |
134 | 136 |
135 // TODO(jamescook): Port ash::sysui::KeyboardUIMus and use it here. | 137 // TODO(jamescook): Port ash::sysui::KeyboardUIMus and use it here. |
136 SetKeyboardUI(KeyboardUI::Create()); | 138 SetKeyboardUI(KeyboardUI::Create()); |
137 } | 139 } |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 335 |
334 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> | 336 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> |
335 WmShellMus::CreateScopedDisableInternalMouseAndKeyboard() { | 337 WmShellMus::CreateScopedDisableInternalMouseAndKeyboard() { |
336 // TODO: needs implementation for mus, http://crbug.com/624967. | 338 // TODO: needs implementation for mus, http://crbug.com/624967. |
337 NOTIMPLEMENTED(); | 339 NOTIMPLEMENTED(); |
338 return nullptr; | 340 return nullptr; |
339 } | 341 } |
340 | 342 |
341 std::unique_ptr<ImmersiveFullscreenController> | 343 std::unique_ptr<ImmersiveFullscreenController> |
342 WmShellMus::CreateImmersiveFullscreenController() { | 344 WmShellMus::CreateImmersiveFullscreenController() { |
343 // TODO(sky): port ImmersiveFullscreenController, http://crbug.com/548435. | 345 return base::MakeUnique<ImmersiveFullscreenController>(); |
344 return nullptr; | |
345 } | 346 } |
346 | 347 |
347 void WmShellMus::OnOverviewModeStarting() { | 348 void WmShellMus::OnOverviewModeStarting() { |
348 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), | 349 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), |
349 OnOverviewModeStarting()); | 350 OnOverviewModeStarting()); |
350 } | 351 } |
351 | 352 |
352 void WmShellMus::OnOverviewModeEnded() { | 353 void WmShellMus::OnOverviewModeEnded() { |
353 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), OnOverviewModeEnded()); | 354 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), OnOverviewModeEnded()); |
354 } | 355 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 OnWindowActivated(gained_active, lost_active)); | 420 OnWindowActivated(gained_active, lost_active)); |
420 } | 421 } |
421 | 422 |
422 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) { | 423 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) { |
423 DCHECK_EQ(window_tree_client(), client); | 424 DCHECK_EQ(window_tree_client(), client); |
424 client->RemoveObserver(this); | 425 client->RemoveObserver(this); |
425 } | 426 } |
426 | 427 |
427 } // namespace mus | 428 } // namespace mus |
428 } // namespace ash | 429 } // namespace ash |
OLD | NEW |