OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/window_server.h" | 5 #include "services/ui/ws/window_server.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 bool WindowServer::IsActiveUserInHighContrastMode() const { | 279 bool WindowServer::IsActiveUserInHighContrastMode() const { |
280 return IsUserInHighContrastMode(user_id_tracker_.active_id()); | 280 return IsUserInHighContrastMode(user_id_tracker_.active_id()); |
281 } | 281 } |
282 | 282 |
283 void WindowServer::SetHighContrastMode(const UserId& user, bool enabled) { | 283 void WindowServer::SetHighContrastMode(const UserId& user, bool enabled) { |
284 // TODO(fsamuel): This doesn't really seem like it's a window server concept? | 284 // TODO(fsamuel): This doesn't really seem like it's a window server concept? |
285 if (IsUserInHighContrastMode(user) == enabled) | 285 if (IsUserInHighContrastMode(user) == enabled) |
286 return; | 286 return; |
287 high_contrast_mode_[user] = enabled; | 287 high_contrast_mode_[user] = enabled; |
| 288 |
| 289 if (user == user_id_tracker_.active_id()) { |
| 290 // Propagate the change to all Displays so that FrameGenerators start |
| 291 // requesting BeginFrames. |
| 292 display_manager_->SetHighContrastMode(enabled); |
| 293 } |
288 } | 294 } |
289 | 295 |
290 uint32_t WindowServer::GenerateWindowManagerChangeId( | 296 uint32_t WindowServer::GenerateWindowManagerChangeId( |
291 WindowTree* source, | 297 WindowTree* source, |
292 uint32_t client_change_id) { | 298 uint32_t client_change_id) { |
293 const uint32_t wm_change_id = next_wm_change_id_++; | 299 const uint32_t wm_change_id = next_wm_change_id_++; |
294 in_flight_wm_change_map_[wm_change_id] = {source->id(), client_change_id}; | 300 in_flight_wm_change_map_[wm_change_id] = {source->id(), client_change_id}; |
295 return wm_change_id; | 301 return wm_change_id; |
296 } | 302 } |
297 | 303 |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 void WindowServer::OnUserIdAdded(const UserId& id) { | 860 void WindowServer::OnUserIdAdded(const UserId& id) { |
855 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 861 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
856 } | 862 } |
857 | 863 |
858 void WindowServer::OnUserIdRemoved(const UserId& id) { | 864 void WindowServer::OnUserIdRemoved(const UserId& id) { |
859 activity_monitor_map_.erase(id); | 865 activity_monitor_map_.erase(id); |
860 } | 866 } |
861 | 867 |
862 } // namespace ws | 868 } // namespace ws |
863 } // namespace ui | 869 } // namespace ui |
OLD | NEW |