| 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/accelerators/accelerator_controller_delegate_aura.h" | 9 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 10 #include "ash/aura/key_event_watcher_aura.h" | 10 #include "ash/aura/key_event_watcher_aura.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "ash/wm/workspace/workspace_event_handler_aura.h" | 48 #include "ash/wm/workspace/workspace_event_handler_aura.h" |
| 49 #include "base/memory/ptr_util.h" | 49 #include "base/memory/ptr_util.h" |
| 50 #include "components/user_manager/user_info_impl.h" | 50 #include "components/user_manager/user_info_impl.h" |
| 51 #include "ui/aura/env.h" | 51 #include "ui/aura/env.h" |
| 52 #include "ui/aura/mus/window_tree_client.h" | 52 #include "ui/aura/mus/window_tree_client.h" |
| 53 #include "ui/aura/mus/window_tree_host_mus.h" | 53 #include "ui/aura/mus/window_tree_host_mus.h" |
| 54 #include "ui/aura/window.h" | 54 #include "ui/aura/window.h" |
| 55 #include "ui/display/manager/managed_display_info.h" | 55 #include "ui/display/manager/managed_display_info.h" |
| 56 #include "ui/display/screen.h" | 56 #include "ui/display/screen.h" |
| 57 #include "ui/views/mus/pointer_watcher_event_router.h" | 57 #include "ui/views/mus/pointer_watcher_event_router.h" |
| 58 #include "ui/wm/core/capture_controller.h" | |
| 59 #include "ui/wm/core/focus_controller.h" | |
| 60 | 58 |
| 61 namespace ash { | 59 namespace ash { |
| 62 namespace mus { | 60 namespace mus { |
| 63 | 61 |
| 64 namespace { | 62 namespace { |
| 65 | 63 |
| 66 // TODO(jamescook): After ShellDelegate is ported to ash/common use | 64 // TODO(jamescook): After ShellDelegate is ported to ash/common use |
| 67 // ShellDelegate::CreateSessionStateDelegate() to construct the mus version | 65 // ShellDelegate::CreateSessionStateDelegate() to construct the mus version |
| 68 // of SessionStateDelegate. | 66 // of SessionStateDelegate. |
| 69 class SessionStateDelegateStub : public SessionStateDelegate { | 67 class SessionStateDelegateStub : public SessionStateDelegate { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 156 } |
| 159 | 157 |
| 160 bool WmShellMus::IsRunningInMash() const { | 158 bool WmShellMus::IsRunningInMash() const { |
| 161 return GetConfig() == Config::MASH; | 159 return GetConfig() == Config::MASH; |
| 162 } | 160 } |
| 163 | 161 |
| 164 Config WmShellMus::GetConfig() const { | 162 Config WmShellMus::GetConfig() const { |
| 165 return window_manager_->config(); | 163 return window_manager_->config(); |
| 166 } | 164 } |
| 167 | 165 |
| 168 WmWindow* WmShellMus::GetFocusedWindow() { | |
| 169 // TODO: remove as both WmShells use same implementation. | |
| 170 return WmWindow::Get( | |
| 171 aura::client::GetFocusClient(Shell::GetPrimaryRootWindow()) | |
| 172 ->GetFocusedWindow()); | |
| 173 } | |
| 174 | |
| 175 WmWindow* WmShellMus::GetActiveWindow() { | |
| 176 // TODO: remove as both WmShells use same implementation. | |
| 177 return WmWindow::Get(wm::GetActiveWindow()); | |
| 178 } | |
| 179 | |
| 180 WmWindow* WmShellMus::GetCaptureWindow() { | |
| 181 // TODO: remove as both WmShells use same implementation. | |
| 182 return WmWindow::Get(::wm::CaptureController::Get()->GetCaptureWindow()); | |
| 183 } | |
| 184 | |
| 185 WmWindow* WmShellMus::GetPrimaryRootWindow() { | 166 WmWindow* WmShellMus::GetPrimaryRootWindow() { |
| 186 // NOTE: This is called before the RootWindowController has been created, so | 167 // NOTE: This is called before the RootWindowController has been created, so |
| 187 // it can't call through to RootWindowController to get all windows. | 168 // it can't call through to RootWindowController to get all windows. |
| 188 return primary_root_window_; | 169 return primary_root_window_; |
| 189 } | 170 } |
| 190 | 171 |
| 191 WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) { | 172 WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) { |
| 192 RootWindowController* root_window_controller = | 173 RootWindowController* root_window_controller = |
| 193 GetRootWindowControllerWithDisplayId(display_id); | 174 GetRootWindowControllerWithDisplayId(display_id); |
| 194 return root_window_controller | 175 return root_window_controller |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 mash_state_->accelerator_controller_registrar = | 465 mash_state_->accelerator_controller_registrar = |
| 485 base ::MakeUnique<AcceleratorControllerRegistrar>( | 466 base ::MakeUnique<AcceleratorControllerRegistrar>( |
| 486 window_manager_, accelerator_namespace_id); | 467 window_manager_, accelerator_namespace_id); |
| 487 return base::MakeUnique<AcceleratorController>( | 468 return base::MakeUnique<AcceleratorController>( |
| 488 mash_state_->accelerator_controller_delegate.get(), | 469 mash_state_->accelerator_controller_delegate.get(), |
| 489 mash_state_->accelerator_controller_registrar.get()); | 470 mash_state_->accelerator_controller_registrar.get()); |
| 490 } | 471 } |
| 491 | 472 |
| 492 } // namespace mus | 473 } // namespace mus |
| 493 } // namespace ash | 474 } // namespace ash |
| OLD | NEW |