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

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: Rebased 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 7fc9bd2556f0b80562c7b4eb5b9c1fa5fef1e4a4..44d21fce37dc401896b944eb61863b268c55f9bc 100644
--- a/components/mus/ws/window_manager_state.cc
+++ b/components/mus/ws/window_manager_state.cc
@@ -127,23 +127,16 @@ bool WindowManagerState::SetCapture(ServerWindow* window,
void WindowManagerState::ReleaseCaptureBlockedByModalWindow(
const ServerWindow* modal_window) {
- if (!capture_window() || !modal_window->is_modal() ||
- !modal_window->IsDrawn())
- return;
-
- if (modal_window->transient_parent() &&
- !modal_window->transient_parent()->Contains(capture_window())) {
- return;
- }
-
- SetCapture(nullptr, false);
+ event_dispatcher_.ReleaseCaptureBlockedByModalWindow(modal_window);
}
void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() {
- if (!capture_window() || !capture_window()->IsBlockedByModalWindow())
- return;
+ event_dispatcher_.ReleaseCaptureBlockedByAnyModalWindow();
+}
- SetCapture(nullptr, false);
+void WindowManagerState::AddSystemModalWindow(ServerWindow* window) {
+ DCHECK(!window->transient_parent());
+ event_dispatcher_.AddSystemModalWindow(window);
}
mojom::DisplayPtr WindowManagerState::ToMojomDisplay() const {

Powered by Google App Engine
This is Rietveld 408576698