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

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

Issue 1818333002: Reland: mus: Enable system modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up comments Created 4 years, 8 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
Index: components/mus/ws/window_manager_state.cc
diff --git a/components/mus/ws/window_manager_state.cc b/components/mus/ws/window_manager_state.cc
index c81bb8cb86b78b4d1ccfc2e6e0649a9e30cc96f3..8d50d55c44f998e3eed9fe5342d63628b33ae78f 100644
--- a/components/mus/ws/window_manager_state.cc
+++ b/components/mus/ws/window_manager_state.cc
@@ -128,8 +128,9 @@ bool WindowManagerState::SetCapture(ServerWindow* window,
void WindowManagerState::ReleaseCaptureBlockedByModalWindow(
const ServerWindow* modal_window) {
if (!capture_window() || !modal_window->is_modal() ||
- !modal_window->IsDrawn())
+ !modal_window->IsDrawn()) {
return;
+ }
if (modal_window->transient_parent() &&
!modal_window->transient_parent()->Contains(capture_window())) {
@@ -140,12 +141,25 @@ void WindowManagerState::ReleaseCaptureBlockedByModalWindow(
}
void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() {
- if (!capture_window() || !capture_window()->IsBlockedByModalWindow())
+ if (!capture_window())
+ return;
+
+ bool has_system_modal =
+ system_modal_window() && system_modal_window()->IsDrawn();
+
+ if (!has_system_modal && !capture_window()->IsBlockedByModalWindow())
return;
SetCapture(nullptr, false);
}
+bool WindowManagerState::SetSystemModalWindow(ServerWindow* window) {
+ DCHECK(!window->transient_parent());
+ if (system_modal_window() == window)
+ return true;
+ return event_dispatcher_.SetSystemModalWindow(window);
+}
+
mojom::DisplayPtr WindowManagerState::ToMojomDisplay() const {
mojom::DisplayPtr display_ptr = display_->ToMojomDisplay();
// TODO(sky): set work area.

Powered by Google App Engine
This is Rietveld 408576698