| 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" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "base/memory/ptr_util.h" | 37 #include "base/memory/ptr_util.h" |
| 38 #include "ui/aura/env.h" | 38 #include "ui/aura/env.h" |
| 39 #include "ui/display/manager/display_manager.h" | 39 #include "ui/display/manager/display_manager.h" |
| 40 | 40 |
| 41 #if defined(USE_X11) | 41 #if defined(USE_X11) |
| 42 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" | 42 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 #if defined(USE_OZONE) | 45 #if defined(USE_OZONE) |
| 46 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.
h" | 46 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.
h" |
| 47 #include "ui/display/types/native_display_delegate.h" |
| 48 #include "ui/ozone/public/ozone_platform.h" |
| 47 #endif | 49 #endif |
| 48 | 50 |
| 49 namespace ash { | 51 namespace ash { |
| 50 | 52 |
| 51 ShellPortClassic::ShellPortClassic() {} | 53 ShellPortClassic::ShellPortClassic() {} |
| 52 | 54 |
| 53 ShellPortClassic::~ShellPortClassic() {} | 55 ShellPortClassic::~ShellPortClassic() {} |
| 54 | 56 |
| 55 // static | 57 // static |
| 56 ShellPortClassic* ShellPortClassic::Get() { | 58 ShellPortClassic* ShellPortClassic::Get() { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } | 234 } |
| 233 | 235 |
| 234 void ShellPortClassic::SetPartialMagnifierEnabled(bool enabled) { | 236 void ShellPortClassic::SetPartialMagnifierEnabled(bool enabled) { |
| 235 Shell::Get()->partial_magnification_controller()->SetEnabled(enabled); | 237 Shell::Get()->partial_magnification_controller()->SetEnabled(enabled); |
| 236 } | 238 } |
| 237 | 239 |
| 238 void ShellPortClassic::CreatePointerWatcherAdapter() { | 240 void ShellPortClassic::CreatePointerWatcherAdapter() { |
| 239 pointer_watcher_adapter_ = base::MakeUnique<PointerWatcherAdapter>(); | 241 pointer_watcher_adapter_ = base::MakeUnique<PointerWatcherAdapter>(); |
| 240 } | 242 } |
| 241 | 243 |
| 244 AshWindowTreeHost* ShellPortClassic::CreateAshWindowTreeHost( |
| 245 const AshWindowTreeHostInitParams& init_params) { |
| 246 // A return value of null results in falling back to the default. |
| 247 return nullptr; |
| 248 } |
| 249 |
| 242 void ShellPortClassic::CreatePrimaryHost() { | 250 void ShellPortClassic::CreatePrimaryHost() { |
| 243 Shell::Get()->window_tree_host_manager()->Start(); | 251 Shell::Get()->window_tree_host_manager()->Start(); |
| 244 AshWindowTreeHostInitParams ash_init_params; | 252 AshWindowTreeHostInitParams ash_init_params; |
| 245 Shell::Get()->window_tree_host_manager()->CreatePrimaryHost(ash_init_params); | 253 Shell::Get()->window_tree_host_manager()->CreatePrimaryHost(ash_init_params); |
| 246 } | 254 } |
| 247 | 255 |
| 248 void ShellPortClassic::InitHosts(const ShellInitParams& init_params) { | 256 void ShellPortClassic::InitHosts(const ShellInitParams& init_params) { |
| 249 Shell::Get()->window_tree_host_manager()->InitHosts(); | 257 Shell::Get()->window_tree_host_manager()->InitHosts(); |
| 250 } | 258 } |
| 251 | 259 |
| 260 std::unique_ptr<display::NativeDisplayDelegate> |
| 261 ShellPortClassic::CreateNativeDisplayDelegate() { |
| 262 return ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(); |
| 263 } |
| 264 |
| 252 std::unique_ptr<AcceleratorController> | 265 std::unique_ptr<AcceleratorController> |
| 253 ShellPortClassic::CreateAcceleratorController() { | 266 ShellPortClassic::CreateAcceleratorController() { |
| 254 DCHECK(!accelerator_controller_delegate_); | 267 DCHECK(!accelerator_controller_delegate_); |
| 255 accelerator_controller_delegate_ = | 268 accelerator_controller_delegate_ = |
| 256 base::MakeUnique<AcceleratorControllerDelegateAura>(); | 269 base::MakeUnique<AcceleratorControllerDelegateAura>(); |
| 257 return base::MakeUnique<AcceleratorController>( | 270 return base::MakeUnique<AcceleratorController>( |
| 258 accelerator_controller_delegate_.get(), nullptr); | 271 accelerator_controller_delegate_.get(), nullptr); |
| 259 } | 272 } |
| 260 | 273 |
| 261 void ShellPortClassic::OnDisplayConfigurationChanging() { | 274 void ShellPortClassic::OnDisplayConfigurationChanging() { |
| 262 for (auto& observer : display_observers_) | 275 for (auto& observer : display_observers_) |
| 263 observer.OnDisplayConfigurationChanging(); | 276 observer.OnDisplayConfigurationChanging(); |
| 264 } | 277 } |
| 265 | 278 |
| 266 void ShellPortClassic::OnDisplayConfigurationChanged() { | 279 void ShellPortClassic::OnDisplayConfigurationChanged() { |
| 267 for (auto& observer : display_observers_) | 280 for (auto& observer : display_observers_) |
| 268 observer.OnDisplayConfigurationChanged(); | 281 observer.OnDisplayConfigurationChanged(); |
| 269 } | 282 } |
| 270 | 283 |
| 271 } // namespace ash | 284 } // namespace ash |
| OLD | NEW |