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

Unified Diff: ash/common/wm/system_modal_container_layout_manager.cc

Issue 2374613004: Use WmLayoutManager::OnChildWindowVisibilityChanged to update the system modal state. (Closed)
Patch Set: Observe WmLayoutManager::OnChildWindowVisibilityChanged to update the systemo modal state. Created 4 years, 3 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: ash/common/wm/system_modal_container_layout_manager.cc
diff --git a/ash/common/wm/system_modal_container_layout_manager.cc b/ash/common/wm/system_modal_container_layout_manager.cc
index 4185abf49d47879c1da3b2e1b42f03f23e5157c8..1a895ab5e5ab4bfd0e2eb5a79393e73392b1826c 100644
--- a/ash/common/wm/system_modal_container_layout_manager.cc
+++ b/ash/common/wm/system_modal_container_layout_manager.cc
@@ -52,6 +52,21 @@ SystemModalContainerLayoutManager::~SystemModalContainerLayoutManager() {
////////////////////////////////////////////////////////////////////////////////
// SystemModalContainerLayoutManager, WmLayoutManager implementation:
+void SystemModalContainerLayoutManager::OnChildWindowVisibilityChanged(
+ WmWindow* window,
+ bool visible) {
+ if (GetModalType(window) != ui::MODAL_TYPE_SYSTEM)
+ return;
+
+ if (window->IsVisible()) {
+ DCHECK(!base::ContainsValue(modal_windows_, window));
+ AddModalWindow(window);
+ } else {
+ if (RemoveModalWindow(window))
+ WmShell::Get()->OnModalWindowRemoved(window);
+ }
+}
+
void SystemModalContainerLayoutManager::OnWindowResized() {
PositionDialogsAfterWorkAreaResize();
}
@@ -110,20 +125,6 @@ void SystemModalContainerLayoutManager::OnWindowPropertyChanged(
}
}
-void SystemModalContainerLayoutManager::OnWindowVisibilityChanged(
- WmWindow* window,
- bool visible) {
- if (GetModalType(window) != ui::MODAL_TYPE_SYSTEM)
- return;
-
- if (window->IsVisible()) {
- AddModalWindow(window);
- } else {
- RemoveModalWindow(window);
- WmShell::Get()->OnModalWindowRemoved(window);
- }
-}
-
////////////////////////////////////////////////////////////////////////////////
// SystemModalContainerLayoutManager, Keyboard::KeybaordControllerObserver
// implementation:
« no previous file with comments | « ash/common/wm/system_modal_container_layout_manager.h ('k') | ash/wm/system_modal_container_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698