 Chromium Code Reviews
 Chromium Code Reviews Issue 1759523002:
  mus: Server-side implementation of modal windows  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1759523002:
  mus: Server-side implementation of modal windows  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 } | 307 } | 
| 308 } | 308 } | 
| 309 | 309 | 
| 310 void ConnectionManager::ProcessWindowHierarchyChanged( | 310 void ConnectionManager::ProcessWindowHierarchyChanged( | 
| 311 const ServerWindow* window, | 311 const ServerWindow* window, | 
| 312 const ServerWindow* new_parent, | 312 const ServerWindow* new_parent, | 
| 313 const ServerWindow* old_parent) { | 313 const ServerWindow* old_parent) { | 
| 314 for (auto& pair : tree_map_) { | 314 for (auto& pair : tree_map_) { | 
| 315 pair.second->ProcessWindowHierarchyChanged(window, new_parent, old_parent, | 315 pair.second->ProcessWindowHierarchyChanged(window, new_parent, old_parent, | 
| 316 IsOperationSource(pair.first)); | 316 IsOperationSource(pair.first)); | 
| 317 } | 317 } | 
| 
sky
2016/03/08 17:07:53
Do you need to call ReleaseCaptureForModalWindow h
 
mohsen
2016/03/09 08:26:48
Yeah, we should release capture if necessary in th
 | |
| 318 } | 318 } | 
| 319 | 319 | 
| 320 void ConnectionManager::ProcessWindowReorder( | 320 void ConnectionManager::ProcessWindowReorder( | 
| 321 const ServerWindow* window, | 321 const ServerWindow* window, | 
| 322 const ServerWindow* relative_window, | 322 const ServerWindow* relative_window, | 
| 323 const mojom::OrderDirection direction) { | 323 const mojom::OrderDirection direction) { | 
| 324 // We'll probably do a bit of reshuffling when we add a transient window. | 324 // We'll probably do a bit of reshuffling when we add a transient window. | 
| 325 if ((current_operation_type() == OperationType::ADD_TRANSIENT_WINDOW) || | 325 if ((current_operation_type() == OperationType::ADD_TRANSIENT_WINDOW) || | 
| 326 (current_operation_type() == | 326 (current_operation_type() == | 
| 327 OperationType::REMOVE_TRANSIENT_WINDOW_FROM_PARENT)) { | 327 OperationType::REMOVE_TRANSIENT_WINDOW_FROM_PARENT)) { | 
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 520 (!window->visible() && window->parent()->IsDrawn()))) { | 520 (!window->visible() && window->parent()->IsDrawn()))) { | 
| 521 SchedulePaint(window->parent(), window->bounds()); | 521 SchedulePaint(window->parent(), window->bounds()); | 
| 522 } | 522 } | 
| 523 | 523 | 
| 524 for (auto& pair : tree_map_) { | 524 for (auto& pair : tree_map_) { | 
| 525 pair.second->ProcessWillChangeWindowVisibility( | 525 pair.second->ProcessWillChangeWindowVisibility( | 
| 526 window, IsOperationSource(pair.first)); | 526 window, IsOperationSource(pair.first)); | 
| 527 } | 527 } | 
| 528 } | 528 } | 
| 529 | 529 | 
| 530 void ConnectionManager::OnWindowVisibilityChanged(ServerWindow* window) { | |
| 531 Display* display = display_manager_->GetDisplayContaining(window); | |
| 532 if (display) | |
| 533 display->ReleaseCaptureForModalWindow(window); | |
| 534 } | |
| 535 | |
| 530 void ConnectionManager::OnWindowPredefinedCursorChanged(ServerWindow* window, | 536 void ConnectionManager::OnWindowPredefinedCursorChanged(ServerWindow* window, | 
| 531 int32_t cursor_id) { | 537 int32_t cursor_id) { | 
| 532 if (in_destructor_) | 538 if (in_destructor_) | 
| 533 return; | 539 return; | 
| 534 | 540 | 
| 535 ProcessWillChangeWindowPredefinedCursor(window, cursor_id); | 541 ProcessWillChangeWindowPredefinedCursor(window, cursor_id); | 
| 536 } | 542 } | 
| 537 | 543 | 
| 538 void ConnectionManager::OnWindowSharedPropertyChanged( | 544 void ConnectionManager::OnWindowSharedPropertyChanged( | 
| 539 ServerWindow* window, | 545 ServerWindow* window, | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 580 void ConnectionManager::OnFirstDisplayReady() { | 586 void ConnectionManager::OnFirstDisplayReady() { | 
| 581 delegate_->OnFirstDisplayReady(); | 587 delegate_->OnFirstDisplayReady(); | 
| 582 } | 588 } | 
| 583 | 589 | 
| 584 void ConnectionManager::OnNoMoreDisplays() { | 590 void ConnectionManager::OnNoMoreDisplays() { | 
| 585 delegate_->OnNoMoreDisplays(); | 591 delegate_->OnNoMoreDisplays(); | 
| 586 } | 592 } | 
| 587 | 593 | 
| 588 } // namespace ws | 594 } // namespace ws | 
| 589 } // namespace mus | 595 } // namespace mus | 
| OLD | NEW |