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

Unified Diff: components/mus/ws/window_tree.cc

Issue 1759523002: mus: Server-side implementation of modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetAsModal -> SetModal + Other review comments addressed 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 90e5c5753798c5af19f6894d208764efa59a28cb..824cb0fea31601e15e4f36a2245f57d7f7210c3f 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -196,8 +196,7 @@ bool WindowTree::SetCapture(const ClientWindowId& client_window_id) {
(!current_capture_window ||
access_policy_->CanSetCapture(current_capture_window)) &&
event_ack_id_) {
- wms->SetCapture(window, !HasRoot(window));
- return true;
+ return wms->SetCapture(window, !HasRoot(window));
}
return false;
}
@@ -244,6 +243,18 @@ bool WindowTree::AddTransientWindow(const ClientWindowId& window_id,
return false;
}
+bool WindowTree::SetModal(const ClientWindowId& window_id) {
+ ServerWindow* window = GetWindowByClientId(window_id);
+ if (window && access_policy_->CanSetModal(window)) {
+ window->SetModal();
+ WindowManagerState* wms = GetWindowManagerState(window);
+ if (wms)
+ wms->ReleaseCaptureBlockedByModalWindow(window);
+ return true;
+ }
+ return false;
+}
+
std::vector<const ServerWindow*> WindowTree::GetWindowTree(
const ClientWindowId& window_id) const {
const ServerWindow* window = GetWindowByClientId(window_id);
@@ -1008,6 +1019,10 @@ void WindowTree::RemoveTransientWindowFromParent(uint32_t change_id,
client()->OnChangeCompleted(change_id, success);
}
+void WindowTree::SetModal(uint32_t change_id, Id window_id) {
+ client()->OnChangeCompleted(change_id, SetModal(ClientWindowId(window_id)));
+}
+
void WindowTree::ReorderWindow(uint32_t change_id,
Id window_id,
Id relative_window_id,
@@ -1048,7 +1063,7 @@ void WindowTree::ReleaseCapture(uint32_t change_id, Id window_id) {
window == current_capture_window;
if (success) {
Operation op(this, connection_manager_, OperationType::RELEASE_CAPTURE);
- wms->SetCapture(nullptr, false);
+ success = wms->SetCapture(nullptr, false);
}
client()->OnChangeCompleted(change_id, success);
}
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698