| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 263 } |
| 264 | 264 |
| 265 display::Display Display::GetDisplay() { | 265 display::Display Display::GetDisplay() { |
| 266 return ToDisplay(); | 266 return ToDisplay(); |
| 267 } | 267 } |
| 268 | 268 |
| 269 ServerWindow* Display::GetRootWindow() { | 269 ServerWindow* Display::GetRootWindow() { |
| 270 return root_.get(); | 270 return root_.get(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 ServerWindow* Display::GetActiveRootWindow() { | |
| 274 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot(); | |
| 275 if (display_root) | |
| 276 return display_root->root(); | |
| 277 return nullptr; | |
| 278 } | |
| 279 | |
| 280 void Display::OnAcceleratedWidgetAvailable() { | 273 void Display::OnAcceleratedWidgetAvailable() { |
| 281 display_manager()->OnDisplayAcceleratedWidgetAvailable(this); | 274 display_manager()->OnDisplayAcceleratedWidgetAvailable(this); |
| 282 InitWindowManagerDisplayRoots(); | 275 InitWindowManagerDisplayRoots(); |
| 283 } | 276 } |
| 284 | 277 |
| 285 bool Display::IsInHighContrastMode() { | 278 bool Display::IsInHighContrastMode() { |
| 286 return window_server_->IsActiveUserInHighContrastMode(); | 279 return window_server_->IsActiveUserInHighContrastMode(); |
| 287 } | 280 } |
| 288 | 281 |
| 289 void Display::OnEvent(const ui::Event& event) { | 282 void Display::OnEvent(const ui::Event& event) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 306 const display::ViewportMetrics& metrics) { | 299 const display::ViewportMetrics& metrics) { |
| 307 if (root_->bounds().size() == metrics.pixel_size) | 300 if (root_->bounds().size() == metrics.pixel_size) |
| 308 return; | 301 return; |
| 309 | 302 |
| 310 gfx::Rect new_bounds(metrics.pixel_size); | 303 gfx::Rect new_bounds(metrics.pixel_size); |
| 311 root_->SetBounds(new_bounds); | 304 root_->SetBounds(new_bounds); |
| 312 for (auto& pair : window_manager_display_root_map_) | 305 for (auto& pair : window_manager_display_root_map_) |
| 313 pair.second->root()->SetBounds(new_bounds); | 306 pair.second->root()->SetBounds(new_bounds); |
| 314 } | 307 } |
| 315 | 308 |
| 309 ServerWindow* Display::GetActiveRootWindow() { |
| 310 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot(); |
| 311 if (display_root) |
| 312 return display_root->root(); |
| 313 return nullptr; |
| 314 } |
| 315 |
| 316 bool Display::CanHaveActiveChildren(ServerWindow* window) const { | 316 bool Display::CanHaveActiveChildren(ServerWindow* window) const { |
| 317 return window && activation_parents_.Contains(window); | 317 return window && activation_parents_.Contains(window); |
| 318 } | 318 } |
| 319 | 319 |
| 320 void Display::OnActivationChanged(ServerWindow* old_active_window, | 320 void Display::OnActivationChanged(ServerWindow* old_active_window, |
| 321 ServerWindow* new_active_window) { | 321 ServerWindow* new_active_window) { |
| 322 // Don't do anything here. We assume the window manager handles restacking. If | 322 // Don't do anything here. We assume the window manager handles restacking. If |
| 323 // we did attempt to restack than we would have to ensure clients see the | 323 // we did attempt to restack than we would have to ensure clients see the |
| 324 // restack. | 324 // restack. |
| 325 } | 325 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 391 } |
| 392 | 392 |
| 393 void Display::OnWindowManagerWindowTreeFactoryReady( | 393 void Display::OnWindowManagerWindowTreeFactoryReady( |
| 394 WindowManagerWindowTreeFactory* factory) { | 394 WindowManagerWindowTreeFactory* factory) { |
| 395 if (!binding_) | 395 if (!binding_) |
| 396 CreateWindowManagerDisplayRootFromFactory(factory); | 396 CreateWindowManagerDisplayRootFromFactory(factory); |
| 397 } | 397 } |
| 398 | 398 |
| 399 } // namespace ws | 399 } // namespace ws |
| 400 } // namespace ui | 400 } // namespace ui |
| OLD | NEW |