Chromium Code Reviews| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 window->DestroySurfacesScheduledForDestruction(); | 344 window->DestroySurfacesScheduledForDestruction(); |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 | 347 |
| 348 bool Display::CanHaveActiveChildren(ServerWindow* window) const { | 348 bool Display::CanHaveActiveChildren(ServerWindow* window) const { |
| 349 return window && activation_parents_.Contains(window); | 349 return window && activation_parents_.Contains(window); |
| 350 } | 350 } |
| 351 | 351 |
| 352 void Display::OnActivationChanged(ServerWindow* old_active_window, | 352 void Display::OnActivationChanged(ServerWindow* old_active_window, |
| 353 ServerWindow* new_active_window) { | 353 ServerWindow* new_active_window) { |
| 354 DCHECK_NE(new_active_window, old_active_window); | 354 // Don't do anything here. We assume the windowmanager handles restacking. If |
|
msw
2016/10/03 23:42:01
nit: 'window manager'?
sky
2016/10/03 23:53:29
Done.
| |
| 355 if (new_active_window && new_active_window->parent()) { | 355 // we did attempt to restack than we would have to ensure clients see the |
| 356 // Raise the new active window. | 356 // restack. |
| 357 // TODO(sad): Let the WM dictate whether to raise the window or not? | |
| 358 new_active_window->parent()->StackChildAtTop(new_active_window); | |
| 359 } | |
| 360 } | 357 } |
| 361 | 358 |
| 362 void Display::OnFocusChanged(FocusControllerChangeSource change_source, | 359 void Display::OnFocusChanged(FocusControllerChangeSource change_source, |
| 363 ServerWindow* old_focused_window, | 360 ServerWindow* old_focused_window, |
| 364 ServerWindow* new_focused_window) { | 361 ServerWindow* new_focused_window) { |
| 365 // TODO(sky): focus is global, not per windowtreehost. Move. | 362 // TODO(sky): focus is global, not per windowtreehost. Move. |
| 366 | 363 |
| 367 // There are up to four clients that need to be notified: | 364 // There are up to four clients that need to be notified: |
| 368 // . the client containing |old_focused_window|. | 365 // . the client containing |old_focused_window|. |
| 369 // . the client with |old_focused_window| as its root. | 366 // . the client with |old_focused_window| as its root. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 } | 428 } |
| 432 | 429 |
| 433 void Display::OnWindowManagerWindowTreeFactoryReady( | 430 void Display::OnWindowManagerWindowTreeFactoryReady( |
| 434 WindowManagerWindowTreeFactory* factory) { | 431 WindowManagerWindowTreeFactory* factory) { |
| 435 if (!binding_) | 432 if (!binding_) |
| 436 CreateWindowManagerDisplayRootFromFactory(factory); | 433 CreateWindowManagerDisplayRootFromFactory(factory); |
| 437 } | 434 } |
| 438 | 435 |
| 439 } // namespace ws | 436 } // namespace ws |
| 440 } // namespace ui | 437 } // namespace ui |
| OLD | NEW |