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 "components/mus/ws/connection_manager.h" | 5 #include "components/mus/ws/connection_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "components/mus/ws/connection_manager_delegate.h" | 9 #include "components/mus/ws/connection_manager_delegate.h" |
10 #include "components/mus/ws/display.h" | 10 #include "components/mus/ws/display.h" |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 454 |
455 ProcessWillChangeWindowHierarchy(window, new_parent, old_parent); | 455 ProcessWillChangeWindowHierarchy(window, new_parent, old_parent); |
456 } | 456 } |
457 | 457 |
458 void ConnectionManager::OnWindowHierarchyChanged(ServerWindow* window, | 458 void ConnectionManager::OnWindowHierarchyChanged(ServerWindow* window, |
459 ServerWindow* new_parent, | 459 ServerWindow* new_parent, |
460 ServerWindow* old_parent) { | 460 ServerWindow* old_parent) { |
461 if (in_destructor_) | 461 if (in_destructor_) |
462 return; | 462 return; |
463 | 463 |
| 464 WindowManagerState* wms = |
| 465 display_manager_->GetWindowManagerAndDisplay(window).window_manager_state; |
| 466 if (wms) |
| 467 wms->ReleaseCaptureBlockedByAnyModalWindow(); |
| 468 |
464 ProcessWindowHierarchyChanged(window, new_parent, old_parent); | 469 ProcessWindowHierarchyChanged(window, new_parent, old_parent); |
465 | 470 |
466 // TODO(beng): optimize. | 471 // TODO(beng): optimize. |
467 if (old_parent) | 472 if (old_parent) |
468 SchedulePaint(old_parent, gfx::Rect(old_parent->bounds().size())); | 473 SchedulePaint(old_parent, gfx::Rect(old_parent->bounds().size())); |
469 if (new_parent) | 474 if (new_parent) |
470 SchedulePaint(new_parent, gfx::Rect(new_parent->bounds().size())); | 475 SchedulePaint(new_parent, gfx::Rect(new_parent->bounds().size())); |
471 | 476 |
472 MaybeUpdateNativeCursor(window); | 477 MaybeUpdateNativeCursor(window); |
473 } | 478 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 (!window->visible() && window->parent()->IsDrawn()))) { | 524 (!window->visible() && window->parent()->IsDrawn()))) { |
520 SchedulePaint(window->parent(), window->bounds()); | 525 SchedulePaint(window->parent(), window->bounds()); |
521 } | 526 } |
522 | 527 |
523 for (auto& pair : tree_map_) { | 528 for (auto& pair : tree_map_) { |
524 pair.second->ProcessWillChangeWindowVisibility( | 529 pair.second->ProcessWillChangeWindowVisibility( |
525 window, IsOperationSource(pair.first)); | 530 window, IsOperationSource(pair.first)); |
526 } | 531 } |
527 } | 532 } |
528 | 533 |
| 534 void ConnectionManager::OnWindowVisibilityChanged(ServerWindow* window) { |
| 535 if (in_destructor_) |
| 536 return; |
| 537 |
| 538 WindowManagerState* wms = |
| 539 display_manager_->GetWindowManagerAndDisplay(window).window_manager_state; |
| 540 if (wms) |
| 541 wms->ReleaseCaptureBlockedByModalWindow(window); |
| 542 } |
| 543 |
529 void ConnectionManager::OnWindowPredefinedCursorChanged(ServerWindow* window, | 544 void ConnectionManager::OnWindowPredefinedCursorChanged(ServerWindow* window, |
530 int32_t cursor_id) { | 545 int32_t cursor_id) { |
531 if (in_destructor_) | 546 if (in_destructor_) |
532 return; | 547 return; |
533 | 548 |
534 ProcessWillChangeWindowPredefinedCursor(window, cursor_id); | 549 ProcessWillChangeWindowPredefinedCursor(window, cursor_id); |
535 } | 550 } |
536 | 551 |
537 void ConnectionManager::OnWindowSharedPropertyChanged( | 552 void ConnectionManager::OnWindowSharedPropertyChanged( |
538 ServerWindow* window, | 553 ServerWindow* window, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 void ConnectionManager::OnFirstDisplayReady() { | 589 void ConnectionManager::OnFirstDisplayReady() { |
575 delegate_->OnFirstDisplayReady(); | 590 delegate_->OnFirstDisplayReady(); |
576 } | 591 } |
577 | 592 |
578 void ConnectionManager::OnNoMoreDisplays() { | 593 void ConnectionManager::OnNoMoreDisplays() { |
579 delegate_->OnNoMoreDisplays(); | 594 delegate_->OnNoMoreDisplays(); |
580 } | 595 } |
581 | 596 |
582 } // namespace ws | 597 } // namespace ws |
583 } // namespace mus | 598 } // namespace mus |
OLD | NEW |