Chromium Code Reviews| Index: components/mus/ws/window_server.cc |
| diff --git a/components/mus/ws/window_server.cc b/components/mus/ws/window_server.cc |
| index 5ee158bb43518ee6971fedf9c034ddde648e6fde..7849e149f34081666bb1403fdf6f0ed5adc0d003 100644 |
| --- a/components/mus/ws/window_server.cc |
| +++ b/components/mus/ws/window_server.cc |
| @@ -16,6 +16,7 @@ |
| #include "components/mus/ws/display_manager.h" |
| #include "components/mus/ws/operation.h" |
| #include "components/mus/ws/server_window.h" |
| +#include "components/mus/ws/user_activity_monitor.h" |
| #include "components/mus/ws/window_coordinate_conversions.h" |
| #include "components/mus/ws/window_manager_access_policy.h" |
| #include "components/mus/ws/window_manager_display_root.h" |
| @@ -40,7 +41,10 @@ WindowServer::WindowServer( |
| current_operation_(nullptr), |
| in_destructor_(false), |
| next_wm_change_id_(0), |
| - window_manager_window_tree_factory_set_(this, &user_id_tracker_) {} |
| + window_manager_window_tree_factory_set_(this, &user_id_tracker_) { |
| + user_id_tracker_.AddObserver(this); |
| + OnUserIdAdded(user_id_tracker_.active_id()); |
|
sadrul
2016/06/27 20:46:13
This is necessary since the 'root user id' is adde
|
| +} |
| WindowServer::~WindowServer() { |
| in_destructor_ = true; |
| @@ -232,6 +236,12 @@ void WindowServer::OnFirstWindowManagerWindowTreeFactoryReady() { |
| delegate_->CreateDefaultDisplays(); |
| } |
| +UserActivityMonitor* WindowServer::GetUserActivityMonitorForUser( |
| + const UserId& user_id) { |
| + DCHECK_GT(activity_monitor_map_.count(user_id), 0u); |
| + return activity_monitor_map_[user_id].get(); |
| +} |
| + |
| bool WindowServer::SetFocusedWindow(ServerWindow* window) { |
| // TODO(sky): this should fail if there is modal dialog active and |window| |
| // is outside that. |
| @@ -683,5 +693,16 @@ WindowManagerState* WindowServer::GetWindowManagerStateForUser( |
| user_id); |
| } |
| +void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, |
| + const UserId& active_id) {} |
| + |
| +void WindowServer::OnUserIdAdded(const UserId& id) { |
| + activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| +} |
| + |
| +void WindowServer::OnUserIdRemoved(const UserId& id) { |
| + activity_monitor_map_.erase(id); |
| +} |
| + |
| } // namespace ws |
| } // namespace mus |