1) Fix repaint glitches wrt to the solo window header when window docking is enabled. The glitches were occurring because windows move to the kShellWindowId_DockedContainer for the duration of a drag and windows were not properly repainted
2) Change the behavior of the solo header such that:
- Docked windows never use the solo window header
- Windows which are not docked cannot use the solo window header when there is a docked window (There must be exactly one window onscreen in order to use the solo window header)
- A window can use the solo window header when it is being dragged even though it is in the kShellWindowId_DockedContainer
BUG=317439
TEST=SoloWindowTrackerTest.DockedWindow
R=jamescook
TBR=sky (For trivial change to chrome/browser/chromeos/login/login_display_host_impl.cc)
Review URL: https://codereview.chromium.org/68373002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235020 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index d66f1690..de8c327 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -36,6 +36,7 @@
#include "ash/wm/panels/panel_window_event_handler.h"
#include "ash/wm/root_window_layout_manager.h"
#include "ash/wm/screen_dimmer.h"
+#include "ash/wm/solo_window_tracker.h"
#include "ash/wm/stacking_controller.h"
#include "ash/wm/status_area_layout_manager.h"
#include "ash/wm/system_background_controller.h"
@@ -396,6 +397,13 @@
void RootWindowController::CloseChildWindows() {
mouse_event_target_.reset();
+ // |solo_window_tracker_| must be shut down before windows are destroyed.
+ if (solo_window_tracker_) {
+ if (docked_layout_manager_)
+ docked_layout_manager_->RemoveObserver(solo_window_tracker_.get());
+ solo_window_tracker_.reset();
+ }
+
// Deactivate keyboard container before closing child windows and shutting
// down associated layout managers.
DeactivateKeyboard(Shell::GetInstance()->keyboard_controller());
@@ -563,7 +571,6 @@
}
}
-
////////////////////////////////////////////////////////////////////////////////
// RootWindowController, private:
@@ -617,10 +624,14 @@
root_window_->window());
root_window_->ShowRootWindow();
- // Create a launcher if a user is already logged.
+ // Create a launcher if a user is already logged in.
if (shell->session_state_delegate()->NumberOfLoggedInUsers())
shelf()->CreateLauncher();
}
+
+ solo_window_tracker_.reset(new SoloWindowTracker(root_window_.get()));
+ if (docked_layout_manager_)
+ docked_layout_manager_->AddObserver(solo_window_tracker_.get());
}
void RootWindowController::InitLayoutManagers() {