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/display/display_info.h" | 10 #include "ash/common/display/display_info.h" |
10 #include "ash/common/keyboard/keyboard_ui.h" | 11 #include "ash/common/keyboard/keyboard_ui.h" |
11 #include "ash/common/session/session_state_delegate.h" | 12 #include "ash/common/session/session_state_delegate.h" |
12 #include "ash/common/shell_delegate.h" | 13 #include "ash/common/shell_delegate.h" |
13 #include "ash/common/shell_observer.h" | 14 #include "ash/common/shell_observer.h" |
14 #include "ash/common/shell_window_ids.h" | 15 #include "ash/common/shell_window_ids.h" |
15 #include "ash/common/system/tray/default_system_tray_delegate.h" | 16 #include "ash/common/system/tray/default_system_tray_delegate.h" |
16 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" | 17 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" |
17 #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" |
18 #include "ash/common/wm/mru_window_tracker.h" | 19 #include "ash/common/wm/mru_window_tracker.h" |
19 #include "ash/common/wm/window_cycle_event_filter.h" | 20 #include "ash/common/wm/window_cycle_event_filter.h" |
20 #include "ash/common/wm/window_resizer.h" | 21 #include "ash/common/wm/window_resizer.h" |
21 #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" |
22 #include "ash/mus/bridge/wm_root_window_controller_mus.h" | 24 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
23 #include "ash/mus/bridge/wm_window_mus.h" | 25 #include "ash/mus/bridge/wm_window_mus.h" |
24 #include "ash/mus/container_ids.h" | 26 #include "ash/mus/container_ids.h" |
25 #include "ash/mus/drag_window_resizer.h" | 27 #include "ash/mus/drag_window_resizer.h" |
26 #include "ash/mus/root_window_controller.h" | 28 #include "ash/mus/root_window_controller.h" |
27 #include "base/memory/ptr_util.h" | 29 #include "base/memory/ptr_util.h" |
28 #include "components/user_manager/user_info_impl.h" | 30 #include "components/user_manager/user_info_impl.h" |
29 #include "services/ui/common/util.h" | 31 #include "services/ui/common/util.h" |
30 #include "services/ui/public/cpp/window.h" | 32 #include "services/ui/public/cpp/window.h" |
31 #include "services/ui/public/cpp/window_tree_client.h" | 33 #include "services/ui/public/cpp/window_tree_client.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } // namespace | 99 } // namespace |
98 | 100 |
99 WmShellMus::WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate, | 101 WmShellMus::WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate, |
100 ::ui::WindowTreeClient* client) | 102 ::ui::WindowTreeClient* client) |
101 : WmShell(std::move(shell_delegate)), | 103 : WmShell(std::move(shell_delegate)), |
102 client_(client), | 104 client_(client), |
103 session_state_delegate_(new SessionStateDelegateStub) { | 105 session_state_delegate_(new SessionStateDelegateStub) { |
104 client_->AddObserver(this); | 106 client_->AddObserver(this); |
105 WmShell::Set(this); | 107 WmShell::Set(this); |
106 | 108 |
| 109 accelerator_controller_delegate_.reset(new AcceleratorControllerDelegateMus); |
| 110 SetAcceleratorController(base::MakeUnique<AcceleratorController>( |
| 111 accelerator_controller_delegate_.get())); |
| 112 |
107 CreateMaximizeModeController(); | 113 CreateMaximizeModeController(); |
108 | 114 |
109 CreateMruWindowTracker(); | 115 CreateMruWindowTracker(); |
110 | 116 |
111 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); | 117 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); |
112 | 118 |
113 // TODO(jamescook): Port ash::sysui::KeyboardUIMus and use it here. | 119 // TODO(jamescook): Port ash::sysui::KeyboardUIMus and use it here. |
114 SetKeyboardUI(KeyboardUI::Create()); | 120 SetKeyboardUI(KeyboardUI::Create()); |
115 } | 121 } |
116 | 122 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 OnWindowActivated(gained_active, lost_active)); | 355 OnWindowActivated(gained_active, lost_active)); |
350 } | 356 } |
351 | 357 |
352 void WmShellMus::OnDidDestroyClient(::ui::WindowTreeClient* client) { | 358 void WmShellMus::OnDidDestroyClient(::ui::WindowTreeClient* client) { |
353 DCHECK_EQ(client, client_); | 359 DCHECK_EQ(client, client_); |
354 RemoveClientObserver(); | 360 RemoveClientObserver(); |
355 } | 361 } |
356 | 362 |
357 } // namespace mus | 363 } // namespace mus |
358 } // namespace ash | 364 } // namespace ash |
OLD | NEW |