| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 ServerWindow* WindowServer::GetFocusedWindow() { | 276 ServerWindow* WindowServer::GetFocusedWindow() { |
| 277 for (Display* display : display_manager_->displays()) { | 277 for (Display* display : display_manager_->displays()) { |
| 278 ServerWindow* focused_window = display->GetFocusedWindow(); | 278 ServerWindow* focused_window = display->GetFocusedWindow(); |
| 279 if (focused_window) | 279 if (focused_window) |
| 280 return focused_window; | 280 return focused_window; |
| 281 } | 281 } |
| 282 return nullptr; | 282 return nullptr; |
| 283 } | 283 } |
| 284 | 284 |
| 285 void WindowServer::SetHighContrastMode(bool enabled) { |
| 286 if (is_in_high_contrast_mode_ == enabled) |
| 287 return; |
| 288 is_in_high_contrast_mode_ = enabled; |
| 289 for (Display* display : display_manager_->displays()) { |
| 290 display->SchedulePaint(display->root_window(), |
| 291 gfx::Rect(display->root_window()->bounds().size())); |
| 292 } |
| 293 } |
| 294 |
| 285 uint32_t WindowServer::GenerateWindowManagerChangeId( | 295 uint32_t WindowServer::GenerateWindowManagerChangeId( |
| 286 WindowTree* source, | 296 WindowTree* source, |
| 287 uint32_t client_change_id) { | 297 uint32_t client_change_id) { |
| 288 const uint32_t wm_change_id = next_wm_change_id_++; | 298 const uint32_t wm_change_id = next_wm_change_id_++; |
| 289 in_flight_wm_change_map_[wm_change_id] = {source->id(), client_change_id}; | 299 in_flight_wm_change_map_[wm_change_id] = {source->id(), client_change_id}; |
| 290 return wm_change_id; | 300 return wm_change_id; |
| 291 } | 301 } |
| 292 | 302 |
| 293 void WindowServer::WindowManagerChangeCompleted( | 303 void WindowServer::WindowManagerChangeCompleted( |
| 294 uint32_t window_manager_change_id, | 304 uint32_t window_manager_change_id, |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 void WindowServer::OnUserIdAdded(const UserId& id) { | 751 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 742 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 752 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 743 } | 753 } |
| 744 | 754 |
| 745 void WindowServer::OnUserIdRemoved(const UserId& id) { | 755 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 746 activity_monitor_map_.erase(id); | 756 activity_monitor_map_.erase(id); |
| 747 } | 757 } |
| 748 | 758 |
| 749 } // namespace ws | 759 } // namespace ws |
| 750 } // namespace ui | 760 } // namespace ui |
| OLD | NEW |