Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1169)

Unified Diff: components/mus/ws/window_server.cc

Issue 2094933003: mus: Add UserActivityMonitor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/window_server.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_server.cc
diff --git a/components/mus/ws/window_server.cc b/components/mus/ws/window_server.cc
index 47cb205611fd8868e34ee6db9fe0b6ce18b107c6..77ef0e2595cf0366fadea9606cd8399f148a1b54 100644
--- a/components/mus/ws/window_server.cc
+++ b/components/mus/ws/window_server.cc
@@ -15,6 +15,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"
@@ -39,7 +40,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());
+}
WindowServer::~WindowServer() {
in_destructor_ = true;
@@ -231,6 +235,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.
@@ -682,5 +692,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
« no previous file with comments | « components/mus/ws/window_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698