| 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/aura/shell_port_classic.h" | 5 #include "ash/aura/shell_port_classic.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/accelerators/accelerator_controller.h" | 9 #include "ash/accelerators/accelerator_controller.h" |
| 10 #include "ash/accelerators/accelerator_controller_delegate_aura.h" | 10 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 11 #include "ash/aura/key_event_watcher_aura.h" | 11 #include "ash/aura/key_event_watcher_aura.h" |
| 12 #include "ash/aura/pointer_watcher_adapter.h" | 12 #include "ash/aura/pointer_watcher_adapter.h" |
| 13 #include "ash/display/window_tree_host_manager.h" | 13 #include "ash/display/window_tree_host_manager.h" |
| 14 #include "ash/host/ash_window_tree_host.h" |
| 14 #include "ash/host/ash_window_tree_host_init_params.h" | 15 #include "ash/host/ash_window_tree_host_init_params.h" |
| 15 #include "ash/keyboard/keyboard_ui.h" | 16 #include "ash/keyboard/keyboard_ui.h" |
| 16 #include "ash/laser/laser_pointer_controller.h" | 17 #include "ash/laser/laser_pointer_controller.h" |
| 17 #include "ash/magnifier/partial_magnification_controller.h" | 18 #include "ash/magnifier/partial_magnification_controller.h" |
| 18 #include "ash/metrics/task_switch_metrics_recorder.h" | 19 #include "ash/metrics/task_switch_metrics_recorder.h" |
| 19 #include "ash/public/cpp/config.h" | 20 #include "ash/public/cpp/config.h" |
| 20 #include "ash/session/session_state_delegate.h" | 21 #include "ash/session/session_state_delegate.h" |
| 21 #include "ash/shared/immersive_fullscreen_controller.h" | 22 #include "ash/shared/immersive_fullscreen_controller.h" |
| 22 #include "ash/shell.h" | 23 #include "ash/shell.h" |
| 23 #include "ash/shell_delegate.h" | 24 #include "ash/shell_delegate.h" |
| 24 #include "ash/shell_observer.h" | 25 #include "ash/shell_observer.h" |
| 25 #include "ash/touch/touch_uma.h" | 26 #include "ash/touch/touch_uma.h" |
| 26 #include "ash/virtual_keyboard_controller.h" | 27 #include "ash/virtual_keyboard_controller.h" |
| 27 #include "ash/wm/drag_window_resizer.h" | 28 #include "ash/wm/drag_window_resizer.h" |
| 28 #include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h" | 29 #include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h" |
| 29 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h" | 30 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h" |
| 30 #include "ash/wm/mru_window_tracker.h" | 31 #include "ash/wm/mru_window_tracker.h" |
| 31 #include "ash/wm/overview/window_selector_controller.h" | 32 #include "ash/wm/overview/window_selector_controller.h" |
| 32 #include "ash/wm/window_cycle_event_filter_aura.h" | 33 #include "ash/wm/window_cycle_event_filter_aura.h" |
| 33 #include "ash/wm/window_util.h" | 34 #include "ash/wm/window_util.h" |
| 34 #include "ash/wm/workspace/workspace_event_handler_aura.h" | 35 #include "ash/wm/workspace/workspace_event_handler_aura.h" |
| 35 #include "ash/wm_display_observer.h" | 36 #include "ash/wm_display_observer.h" |
| 36 #include "ash/wm_window.h" | 37 #include "ash/wm_window.h" |
| 37 #include "base/memory/ptr_util.h" | 38 #include "base/memory/ptr_util.h" |
| 38 #include "ui/aura/env.h" | 39 #include "ui/aura/env.h" |
| 39 #include "ui/display/manager/display_manager.h" | 40 #include "ui/display/manager/display_manager.h" |
| 41 #include "ui/display/types/native_display_delegate.h" |
| 40 | 42 |
| 41 #if defined(USE_X11) | 43 #if defined(USE_X11) |
| 42 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" | 44 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" |
| 43 #endif | 45 #endif |
| 44 | 46 |
| 45 #if defined(USE_OZONE) | 47 #if defined(USE_OZONE) |
| 46 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.
h" | 48 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.
h" |
| 49 #include "ui/display/types/native_display_delegate.h" |
| 50 #include "ui/ozone/public/ozone_platform.h" |
| 47 #endif | 51 #endif |
| 48 | 52 |
| 49 namespace ash { | 53 namespace ash { |
| 50 | 54 |
| 51 ShellPortClassic::ShellPortClassic() {} | 55 ShellPortClassic::ShellPortClassic() {} |
| 52 | 56 |
| 53 ShellPortClassic::~ShellPortClassic() {} | 57 ShellPortClassic::~ShellPortClassic() {} |
| 54 | 58 |
| 55 // static | 59 // static |
| 56 ShellPortClassic* ShellPortClassic::Get() { | 60 ShellPortClassic* ShellPortClassic::Get() { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } | 236 } |
| 233 | 237 |
| 234 void ShellPortClassic::SetPartialMagnifierEnabled(bool enabled) { | 238 void ShellPortClassic::SetPartialMagnifierEnabled(bool enabled) { |
| 235 Shell::Get()->partial_magnification_controller()->SetEnabled(enabled); | 239 Shell::Get()->partial_magnification_controller()->SetEnabled(enabled); |
| 236 } | 240 } |
| 237 | 241 |
| 238 void ShellPortClassic::CreatePointerWatcherAdapter() { | 242 void ShellPortClassic::CreatePointerWatcherAdapter() { |
| 239 pointer_watcher_adapter_ = base::MakeUnique<PointerWatcherAdapter>(); | 243 pointer_watcher_adapter_ = base::MakeUnique<PointerWatcherAdapter>(); |
| 240 } | 244 } |
| 241 | 245 |
| 246 std::unique_ptr<AshWindowTreeHost> ShellPortClassic::CreateAshWindowTreeHost( |
| 247 const AshWindowTreeHostInitParams& init_params) { |
| 248 // A return value of null results in falling back to the default. |
| 249 return nullptr; |
| 250 } |
| 251 |
| 242 void ShellPortClassic::CreatePrimaryHost() { | 252 void ShellPortClassic::CreatePrimaryHost() { |
| 243 Shell::Get()->window_tree_host_manager()->Start(); | 253 Shell::Get()->window_tree_host_manager()->Start(); |
| 244 AshWindowTreeHostInitParams ash_init_params; | 254 AshWindowTreeHostInitParams ash_init_params; |
| 245 Shell::Get()->window_tree_host_manager()->CreatePrimaryHost(ash_init_params); | 255 Shell::Get()->window_tree_host_manager()->CreatePrimaryHost(ash_init_params); |
| 246 } | 256 } |
| 247 | 257 |
| 248 void ShellPortClassic::InitHosts(const ShellInitParams& init_params) { | 258 void ShellPortClassic::InitHosts(const ShellInitParams& init_params) { |
| 249 Shell::Get()->window_tree_host_manager()->InitHosts(); | 259 Shell::Get()->window_tree_host_manager()->InitHosts(); |
| 250 } | 260 } |
| 251 | 261 |
| 262 std::unique_ptr<display::NativeDisplayDelegate> |
| 263 ShellPortClassic::CreateNativeDisplayDelegate() { |
| 264 #if defined(USE_OZONE) |
| 265 return ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(); |
| 266 #else |
| 267 return nullptr; |
| 268 #endif |
| 269 } |
| 270 |
| 252 std::unique_ptr<AcceleratorController> | 271 std::unique_ptr<AcceleratorController> |
| 253 ShellPortClassic::CreateAcceleratorController() { | 272 ShellPortClassic::CreateAcceleratorController() { |
| 254 DCHECK(!accelerator_controller_delegate_); | 273 DCHECK(!accelerator_controller_delegate_); |
| 255 accelerator_controller_delegate_ = | 274 accelerator_controller_delegate_ = |
| 256 base::MakeUnique<AcceleratorControllerDelegateAura>(); | 275 base::MakeUnique<AcceleratorControllerDelegateAura>(); |
| 257 return base::MakeUnique<AcceleratorController>( | 276 return base::MakeUnique<AcceleratorController>( |
| 258 accelerator_controller_delegate_.get(), nullptr); | 277 accelerator_controller_delegate_.get(), nullptr); |
| 259 } | 278 } |
| 260 | 279 |
| 261 void ShellPortClassic::OnDisplayConfigurationChanging() { | 280 void ShellPortClassic::OnDisplayConfigurationChanging() { |
| 262 for (auto& observer : display_observers_) | 281 for (auto& observer : display_observers_) |
| 263 observer.OnDisplayConfigurationChanging(); | 282 observer.OnDisplayConfigurationChanging(); |
| 264 } | 283 } |
| 265 | 284 |
| 266 void ShellPortClassic::OnDisplayConfigurationChanged() { | 285 void ShellPortClassic::OnDisplayConfigurationChanged() { |
| 267 for (auto& observer : display_observers_) | 286 for (auto& observer : display_observers_) |
| 268 observer.OnDisplayConfigurationChanged(); | 287 observer.OnDisplayConfigurationChanged(); |
| 269 } | 288 } |
| 270 | 289 |
| 271 } // namespace ash | 290 } // namespace ash |
| OLD | NEW |