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

Unified Diff: ash/common/wm/dock/docked_window_layout_manager.cc

Issue 2234033002: mash: Remove WorkspaceLayoutManagerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove WmRootWindowControllerObserver::OnFullscreenStateChanged; use ShellObserver. Created 4 years, 4 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/dock/docked_window_layout_manager.cc
diff --git a/ash/common/wm/dock/docked_window_layout_manager.cc b/ash/common/wm/dock/docked_window_layout_manager.cc
index 10c6bc2015546d7158e1a5af82a097efe0b4368f..6905634707b437bfcd36d677b68afa1b4206eb26 100644
--- a/ash/common/wm/dock/docked_window_layout_manager.cc
+++ b/ash/common/wm/dock/docked_window_layout_manager.cc
@@ -770,7 +770,7 @@ void DockedWindowLayoutManager::SetChildBounds(
}
////////////////////////////////////////////////////////////////////////////////
-// DockedWindowLayoutManager, ash::ShellObserver implementation:
+// DockedWindowLayoutManager, WmRootWindowControllerObserver implementation:
void DockedWindowLayoutManager::OnWorkAreaChanged() {
Relayout();
@@ -778,32 +778,6 @@ void DockedWindowLayoutManager::OnWorkAreaChanged() {
MaybeMinimizeChildrenExcept(dragged_window_);
}
-void DockedWindowLayoutManager::OnFullscreenStateChanged(bool is_fullscreen) {
- // Entering fullscreen mode (including immersive) hides docked windows.
- in_fullscreen_ = root_window_controller_->GetWorkspaceWindowState() ==
- wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN;
- {
- // prevent Relayout from getting called multiple times during this
- base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true);
- // Use a copy of children array because a call to MinimizeDockedWindow or
- // RestoreDockedWindow can change order.
- for (WmWindow* window : dock_container_->GetChildren()) {
- if (IsPopupOrTransient(window))
- continue;
- wm::WindowState* window_state = window->GetWindowState();
- if (in_fullscreen_) {
- if (window->IsVisible())
- MinimizeDockedWindow(window_state);
- } else {
- if (!window_state->IsMinimized())
- RestoreDockedWindow(window_state);
- }
- }
- }
- Relayout();
- UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED);
-}
-
void DockedWindowLayoutManager::OnShelfAlignmentChanged() {
if (!shelf_ || alignment_ == DOCKED_ALIGNMENT_NONE)
return;
@@ -922,7 +896,34 @@ void DockedWindowLayoutManager::OnShelfAlignmentChanged(WmWindow* root_window) {
void DockedWindowLayoutManager::OnFullscreenStateChanged(
bool is_fullscreen,
- WmWindow* root_window) {}
+ WmWindow* root_window) {
+ if (root_window != dock_container_->GetRootWindow())
+ return;
+
+ // Entering fullscreen mode (including immersive) hides docked windows.
+ in_fullscreen_ = root_window_controller_->GetWorkspaceWindowState() ==
+ wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN;
+ {
+ // prevent Relayout from getting called multiple times during this
+ base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true);
+ // Use a copy of children array because a call to MinimizeDockedWindow or
+ // RestoreDockedWindow can change order.
+ for (WmWindow* window : dock_container_->GetChildren()) {
+ if (IsPopupOrTransient(window))
+ continue;
+ wm::WindowState* window_state = window->GetWindowState();
+ if (in_fullscreen_) {
+ if (window->IsVisible())
+ MinimizeDockedWindow(window_state);
+ } else {
+ if (!window_state->IsMinimized())
+ RestoreDockedWindow(window_state);
+ }
+ }
+ }
+ Relayout();
+ UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED);
+}
void DockedWindowLayoutManager::OnOverviewModeStarting() {
in_overview_ = true;
« no previous file with comments | « ash/common/wm/dock/docked_window_layout_manager.h ('k') | ash/common/wm/workspace/workspace_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698