Chromium Code Reviews| 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/key_event_watcher.h" | 10 #include "ash/common/key_event_watcher.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 #include "ash/mus/bridge/workspace_event_handler_mus.h" | 25 #include "ash/mus/bridge/workspace_event_handler_mus.h" |
| 26 #include "ash/mus/drag_window_resizer.h" | 26 #include "ash/mus/drag_window_resizer.h" |
| 27 #include "ash/mus/keyboard_ui_mus.h" | 27 #include "ash/mus/keyboard_ui_mus.h" |
| 28 #include "ash/mus/screen_mus.h" | 28 #include "ash/mus/screen_mus.h" |
| 29 #include "ash/mus/window_manager.h" | 29 #include "ash/mus/window_manager.h" |
| 30 #include "ash/root_window_controller.h" | 30 #include "ash/root_window_controller.h" |
| 31 #include "ash/root_window_settings.h" | 31 #include "ash/root_window_settings.h" |
| 32 #include "ash/shared/immersive_fullscreen_controller.h" | 32 #include "ash/shared/immersive_fullscreen_controller.h" |
| 33 #include "ash/shell.h" | 33 #include "ash/shell.h" |
| 34 #include "ash/shell_init_params.h" | 34 #include "ash/shell_init_params.h" |
| 35 #include "ash/wm/lock_state_controller.h" | |
| 35 #include "ash/wm/window_util.h" | 36 #include "ash/wm/window_util.h" |
| 36 #include "base/memory/ptr_util.h" | 37 #include "base/memory/ptr_util.h" |
| 37 #include "components/user_manager/user_info_impl.h" | 38 #include "components/user_manager/user_info_impl.h" |
| 38 #include "ui/aura/mus/window_tree_client.h" | 39 #include "ui/aura/mus/window_tree_client.h" |
| 39 #include "ui/aura/mus/window_tree_host_mus.h" | 40 #include "ui/aura/mus/window_tree_host_mus.h" |
| 40 #include "ui/aura/window.h" | 41 #include "ui/aura/window.h" |
| 41 #include "ui/display/manager/managed_display_info.h" | 42 #include "ui/display/manager/managed_display_info.h" |
| 42 #include "ui/display/screen.h" | 43 #include "ui/display/screen.h" |
| 43 #include "ui/views/mus/pointer_watcher_event_router.h" | 44 #include "ui/views/mus/pointer_watcher_event_router.h" |
| 44 #include "ui/wm/core/capture_controller.h" | 45 #include "ui/wm/core/capture_controller.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 56 public: | 57 public: |
| 57 SessionStateDelegateStub() | 58 SessionStateDelegateStub() |
| 58 : screen_locked_(false), user_info_(new user_manager::UserInfoImpl()) {} | 59 : screen_locked_(false), user_info_(new user_manager::UserInfoImpl()) {} |
| 59 | 60 |
| 60 ~SessionStateDelegateStub() override {} | 61 ~SessionStateDelegateStub() override {} |
| 61 | 62 |
| 62 // SessionStateDelegate: | 63 // SessionStateDelegate: |
| 63 int GetMaximumNumberOfLoggedInUsers() const override { return 3; } | 64 int GetMaximumNumberOfLoggedInUsers() const override { return 3; } |
| 64 int NumberOfLoggedInUsers() const override { return 1; } | 65 int NumberOfLoggedInUsers() const override { return 1; } |
| 65 bool IsActiveUserSessionStarted() const override { return true; } | 66 bool IsActiveUserSessionStarted() const override { return true; } |
| 66 bool CanLockScreen() const override { return true; } | 67 bool CanLockScreen() const override { |
| 68 // The Chrome OS session_manager process currently rejects screen-lock | |
| 69 // requests due to no user being logged in. | |
| 70 return false; | |
| 71 } | |
| 67 bool IsScreenLocked() const override { return screen_locked_; } | 72 bool IsScreenLocked() const override { return screen_locked_; } |
| 68 bool ShouldLockScreenAutomatically() const override { return false; } | 73 bool ShouldLockScreenAutomatically() const override { return false; } |
| 69 void LockScreen() override { | 74 void LockScreen() override { |
| 70 screen_locked_ = true; | 75 screen_locked_ = true; |
| 71 NOTIMPLEMENTED(); | 76 NOTIMPLEMENTED(); |
| 72 } | 77 } |
| 73 void UnlockScreen() override { | 78 void UnlockScreen() override { |
| 74 NOTIMPLEMENTED(); | 79 NOTIMPLEMENTED(); |
| 75 screen_locked_ = false; | 80 screen_locked_ = false; |
| 76 } | 81 } |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 383 // NOTIMPLEMENTED drags for mus pointer watcher. | 388 // NOTIMPLEMENTED drags for mus pointer watcher. |
| 384 pointer_watcher_event_router_->AddPointerWatcher( | 389 pointer_watcher_event_router_->AddPointerWatcher( |
| 385 watcher, events == views::PointerWatcherEventTypes::MOVES); | 390 watcher, events == views::PointerWatcherEventTypes::MOVES); |
| 386 } | 391 } |
| 387 | 392 |
| 388 void WmShellMus::RemovePointerWatcher(views::PointerWatcher* watcher) { | 393 void WmShellMus::RemovePointerWatcher(views::PointerWatcher* watcher) { |
| 389 pointer_watcher_event_router_->RemovePointerWatcher(watcher); | 394 pointer_watcher_event_router_->RemovePointerWatcher(watcher); |
| 390 } | 395 } |
| 391 | 396 |
| 392 void WmShellMus::RequestShutdown() { | 397 void WmShellMus::RequestShutdown() { |
| 393 NOTIMPLEMENTED(); | 398 Shell::GetInstance()->lock_state_controller()->RequestShutdown(); |
|
James Cook
2017/01/25 01:02:59
It looks like this is the same implementation as W
Daniel Erat
2017/01/25 01:10:51
good suggestion. i think that this method is only
James Cook
2017/01/25 01:17:38
I think we're OK using ash::Shell::GetInstance() n
Daniel Erat
2017/01/25 01:40:19
ah, i see that there's a relevant todo in ash/comm
James Cook
2017/01/25 01:45:23
I wouldn't move LSC to ash/common - I think this c
Daniel Erat
2017/01/25 02:06:10
thanks, i've made this change and am testing the D
| |
| 394 } | 399 } |
| 395 | 400 |
| 396 bool WmShellMus::IsTouchDown() { | 401 bool WmShellMus::IsTouchDown() { |
| 397 // TODO: implement me, http://crbug.com/634967. | 402 // TODO: implement me, http://crbug.com/634967. |
| 398 // NOTIMPLEMENTED is too spammy here. | 403 // NOTIMPLEMENTED is too spammy here. |
| 399 return false; | 404 return false; |
| 400 } | 405 } |
| 401 | 406 |
| 402 void WmShellMus::ToggleIgnoreExternalKeyboard() { | 407 void WmShellMus::ToggleIgnoreExternalKeyboard() { |
| 403 NOTIMPLEMENTED(); | 408 NOTIMPLEMENTED(); |
| 404 } | 409 } |
| 405 | 410 |
| 406 void WmShellMus::SetLaserPointerEnabled(bool enabled) { | 411 void WmShellMus::SetLaserPointerEnabled(bool enabled) { |
| 407 NOTIMPLEMENTED(); | 412 NOTIMPLEMENTED(); |
| 408 } | 413 } |
| 409 | 414 |
| 410 void WmShellMus::CreatePointerWatcherAdapter() { | 415 void WmShellMus::CreatePointerWatcherAdapter() { |
| 411 // Only needed in WmShellAura, which has specific creation order. | 416 // Only needed in WmShellAura, which has specific creation order. |
| 412 } | 417 } |
| 413 | 418 |
| 414 void WmShellMus::CreatePrimaryHost() {} | 419 void WmShellMus::CreatePrimaryHost() {} |
| 415 | 420 |
| 416 void WmShellMus::InitHosts(const ShellInitParams& init_params) { | 421 void WmShellMus::InitHosts(const ShellInitParams& init_params) { |
| 417 window_manager_->CreatePrimaryRootWindowController( | 422 window_manager_->CreatePrimaryRootWindowController( |
| 418 base::WrapUnique(init_params.primary_window_tree_host)); | 423 base::WrapUnique(init_params.primary_window_tree_host)); |
| 419 } | 424 } |
| 420 } // namespace mus | 425 } // namespace mus |
| 421 } // namespace ash | 426 } // namespace ash |
| OLD | NEW |