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

Unified Diff: ash/common/wm_shell.cc

Issue 2336653002: Ports SystemModalContainerLayoutManager to ash/common (Closed)
Patch Set: merge again 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
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/common/wm_window_property.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index e4d778ccc4066adc908135cd226e2e7b164fd82c..a29a9954f862b6477ab219a52e41697383ebebaf 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -31,7 +31,9 @@
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm/overview/window_selector_controller.h"
+#include "ash/common/wm/system_modal_container_layout_manager.h"
#include "ash/common/wm/window_cycle_controller.h"
+#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "base/bind.h"
#include "base/logging.h"
@@ -200,6 +202,10 @@ WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate)
WmShell::~WmShell() {}
+WmRootWindowController* WmShell::GetPrimaryRootWindowController() {
+ return GetPrimaryRootWindow()->GetRootWindowController();
+}
+
WmWindow* WmShell::GetRootWindowForNewWindows() {
if (scoped_root_window_for_new_windows_)
return scoped_root_window_for_new_windows_;
@@ -226,6 +232,30 @@ bool WmShell::IsSystemModalWindowOpen() {
return false;
}
+void WmShell::CreateModalBackground(WmWindow* window) {
+ for (WmWindow* root_window : GetAllRootWindows()) {
+ root_window->GetRootWindowController()
+ ->GetSystemModalLayoutManager(window)
+ ->CreateModalBackground();
+ }
+}
+
+void WmShell::OnModalWindowRemoved(WmWindow* removed) {
+ WmWindow::Windows root_windows = GetAllRootWindows();
+ for (WmWindow* root_window : root_windows) {
+ if (root_window->GetRootWindowController()
+ ->GetSystemModalLayoutManager(removed)
+ ->ActivateNextModalWindow()) {
+ return;
+ }
+ }
+ for (WmWindow* root_window : root_windows) {
+ root_window->GetRootWindowController()
+ ->GetSystemModalLayoutManager(removed)
+ ->DestroyModalBackground();
+ }
+}
+
void WmShell::ShowAppList() {
// Show the app list on the default display for new windows.
int64_t display_id =
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/common/wm_window_property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698