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

Side by Side Diff: services/ui/ws/window_server.cc

Issue 2759933007: [mus]Add FrameGenerator::SetHighContrastMode(bool) (Closed)
Patch Set: Addressed nit and removed instances of FrameGeneratorDelegate Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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
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 { 279 bool WindowServer::IsActiveUserInHighContrastMode() const {
sadrul 2017/03/20 23:47:10 Can you remove this code too? (and PlatformDisplay
Alex Z. 2017/03/21 14:11:31 Done.
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
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
OLDNEW
« services/ui/ws/frame_generator_unittest.cc ('K') | « services/ui/ws/test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698