| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 269 |
| 270 ServerWindow* WindowServer::GetFocusedWindow() { | 270 ServerWindow* WindowServer::GetFocusedWindow() { |
| 271 for (Display* display : display_manager_->displays()) { | 271 for (Display* display : display_manager_->displays()) { |
| 272 ServerWindow* focused_window = display->GetFocusedWindow(); | 272 ServerWindow* focused_window = display->GetFocusedWindow(); |
| 273 if (focused_window) | 273 if (focused_window) |
| 274 return focused_window; | 274 return focused_window; |
| 275 } | 275 } |
| 276 return nullptr; | 276 return nullptr; |
| 277 } | 277 } |
| 278 | 278 |
| 279 bool WindowServer::IsActiveUserInHighContrastMode() const { | |
| 280 return IsUserInHighContrastMode(user_id_tracker_.active_id()); | |
| 281 } | |
| 282 | |
| 283 void WindowServer::SetHighContrastMode(const UserId& user, bool enabled) { | 279 void WindowServer::SetHighContrastMode(const UserId& user, bool enabled) { |
| 284 // TODO(fsamuel): This doesn't really seem like it's a window server concept? | 280 // TODO(fsamuel): This doesn't really seem like it's a window server concept? |
| 285 if (IsUserInHighContrastMode(user) == enabled) | 281 if (IsUserInHighContrastMode(user) == enabled) |
| 286 return; | 282 return; |
| 287 high_contrast_mode_[user] = enabled; | 283 high_contrast_mode_[user] = enabled; |
| 284 |
| 285 if (user == user_id_tracker_.active_id()) { |
| 286 // Propagate the change to all Displays so that FrameGenerators start |
| 287 // requesting BeginFrames. |
| 288 display_manager_->SetHighContrastMode(enabled); |
| 289 } |
| 288 } | 290 } |
| 289 | 291 |
| 290 uint32_t WindowServer::GenerateWindowManagerChangeId( | 292 uint32_t WindowServer::GenerateWindowManagerChangeId( |
| 291 WindowTree* source, | 293 WindowTree* source, |
| 292 uint32_t client_change_id) { | 294 uint32_t client_change_id) { |
| 293 const uint32_t wm_change_id = next_wm_change_id_++; | 295 const uint32_t wm_change_id = next_wm_change_id_++; |
| 294 in_flight_wm_change_map_[wm_change_id] = {source->id(), client_change_id}; | 296 in_flight_wm_change_map_[wm_change_id] = {source->id(), client_change_id}; |
| 295 return wm_change_id; | 297 return wm_change_id; |
| 296 } | 298 } |
| 297 | 299 |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 void WindowServer::OnUserIdAdded(const UserId& id) { | 856 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 855 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 857 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 856 } | 858 } |
| 857 | 859 |
| 858 void WindowServer::OnUserIdRemoved(const UserId& id) { | 860 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 859 activity_monitor_map_.erase(id); | 861 activity_monitor_map_.erase(id); |
| 860 } | 862 } |
| 861 | 863 |
| 862 } // namespace ws | 864 } // namespace ws |
| 863 } // namespace ui | 865 } // namespace ui |
| OLD | NEW |