OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/display.h" | 5 #include "services/ui/ws/display.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 display_root->window_manager_state_ = window_manager_state; | 278 display_root->window_manager_state_ = window_manager_state; |
279 const bool is_active = | 279 const bool is_active = |
280 factory->user_id() == window_server_->user_id_tracker()->active_id(); | 280 factory->user_id() == window_server_->user_id_tracker()->active_id(); |
281 display_root->root()->SetVisible(is_active); | 281 display_root->root()->SetVisible(is_active); |
282 window_manager_state->window_tree()->AddRootForWindowManager( | 282 window_manager_state->window_tree()->AddRootForWindowManager( |
283 display_root->root()); | 283 display_root->root()); |
284 window_manager_state->AddWindowManagerDisplayRoot( | 284 window_manager_state->AddWindowManagerDisplayRoot( |
285 std::move(display_root_ptr)); | 285 std::move(display_root_ptr)); |
286 } | 286 } |
287 | 287 |
| 288 ServerWindow* Display::GetActiveRootWindow() { |
| 289 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot(); |
| 290 if (display_root) |
| 291 return display_root->root(); |
| 292 return nullptr; |
| 293 } |
| 294 |
288 ServerWindow* Display::GetRootWindow() { | 295 ServerWindow* Display::GetRootWindow() { |
289 return root_.get(); | 296 return root_.get(); |
290 } | 297 } |
291 | 298 |
292 bool Display::IsInHighContrastMode() { | 299 bool Display::IsInHighContrastMode() { |
293 return window_server_->IsActiveUserInHighContrastMode(); | 300 return window_server_->IsActiveUserInHighContrastMode(); |
294 } | 301 } |
295 | 302 |
296 void Display::OnEvent(const ui::Event& event) { | 303 void Display::OnEvent(const ui::Event& event) { |
297 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot(); | 304 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 432 } |
426 | 433 |
427 void Display::OnWindowManagerWindowTreeFactoryReady( | 434 void Display::OnWindowManagerWindowTreeFactoryReady( |
428 WindowManagerWindowTreeFactory* factory) { | 435 WindowManagerWindowTreeFactory* factory) { |
429 if (!binding_) | 436 if (!binding_) |
430 CreateWindowManagerDisplayRootFromFactory(factory); | 437 CreateWindowManagerDisplayRootFromFactory(factory); |
431 } | 438 } |
432 | 439 |
433 } // namespace ws | 440 } // namespace ws |
434 } // namespace ui | 441 } // namespace ui |
OLD | NEW |