Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: components/mus/ws/connection_manager.cc

Issue 1759523002: mus: Server-side implementation of modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed some review comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/default_access_policy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/client_connection.h" 9 #include "components/mus/ws/client_connection.h"
10 #include "components/mus/ws/connection_manager_delegate.h" 10 #include "components/mus/ws/connection_manager_delegate.h"
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 (!window->visible() && window->parent()->IsDrawn()))) { 668 (!window->visible() && window->parent()->IsDrawn()))) {
669 SchedulePaint(window->parent(), window->bounds()); 669 SchedulePaint(window->parent(), window->bounds());
670 } 670 }
671 671
672 for (auto& pair : connection_map_) { 672 for (auto& pair : connection_map_) {
673 pair.second->service()->ProcessWillChangeWindowVisibility( 673 pair.second->service()->ProcessWillChangeWindowVisibility(
674 window, IsOperationSource(pair.first)); 674 window, IsOperationSource(pair.first));
675 } 675 }
676 } 676 }
677 677
678 void ConnectionManager::OnWindowVisibilityChanged(ServerWindow* window) {
sky 2016/03/04 17:00:42 What if the window is made modal when it's already
mohsen 2016/03/05 01:21:53 Both cases added.
679 if (!window->is_modal() || !window->IsDrawn())
680 return;
681
682 WindowTreeHostImpl* host = GetWindowTreeHostByWindow(window);
683 ServerWindow* capture_window = host->GetCaptureWindow();
684 if (window->transient_parent() &&
685 !window->transient_parent()->Contains(capture_window)) {
686 return;
687 }
688
689 host->SetCapture(nullptr, false);
690 }
691
678 void ConnectionManager::OnWindowPredefinedCursorChanged(ServerWindow* window, 692 void ConnectionManager::OnWindowPredefinedCursorChanged(ServerWindow* window,
679 int32_t cursor_id) { 693 int32_t cursor_id) {
680 if (in_destructor_) 694 if (in_destructor_)
681 return; 695 return;
682 696
683 ProcessWillChangeWindowPredefinedCursor(window, cursor_id); 697 ProcessWillChangeWindowPredefinedCursor(window, cursor_id);
684 } 698 }
685 699
686 void ConnectionManager::OnWindowSharedPropertyChanged( 700 void ConnectionManager::OnWindowSharedPropertyChanged(
687 ServerWindow* window, 701 ServerWindow* window,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 if (!got_valid_frame_decorations_) { 741 if (!got_valid_frame_decorations_) {
728 display_manager_observers_.AddInterfacePtr(std::move(observer)); 742 display_manager_observers_.AddInterfacePtr(std::move(observer));
729 return; 743 return;
730 } 744 }
731 CallOnDisplays(observer.get()); 745 CallOnDisplays(observer.get());
732 display_manager_observers_.AddInterfacePtr(std::move(observer)); 746 display_manager_observers_.AddInterfacePtr(std::move(observer));
733 } 747 }
734 748
735 } // namespace ws 749 } // namespace ws
736 } // namespace mus 750 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/default_access_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698