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

Unified Diff: ash/common/wm_shell.cc

Issue 2573703003: chromeos: Fix shelf appearing at login screen under mash (Closed)
Patch Set: rebase and cleanup Created 4 years 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/mus/test/ash_test_impl_mus.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 7f4f6838c81b86ac8ba0a2454a7f6970164a5456..4580f99b9ae90401975520c9a23bf760bb4212d6 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -151,11 +151,6 @@ void WmShell::CreateShelf() {
root_window->GetRootWindowController()->CreateShelf();
}
-void WmShell::ShowShelf() {
- for (WmWindow* root_window : GetAllRootWindows())
- root_window->GetRootWindowController()->ShowShelf();
-}
-
void WmShell::CreateShelfDelegate() {
// May be called multiple times as shelves are created and destroyed.
if (shelf_delegate_)
@@ -272,9 +267,12 @@ WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate)
keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController);
vpn_list_ = base::MakeUnique<VpnList>();
#endif
+ session_controller_->AddSessionStateObserver(this);
}
-WmShell::~WmShell() {}
+WmShell::~WmShell() {
+ session_controller_->RemoveSessionStateObserver(this);
+}
WmRootWindowController* WmShell::GetPrimaryRootWindowController() {
return GetPrimaryRootWindow()->GetRootWindowController();
@@ -415,4 +413,14 @@ void WmShell::SetAcceleratorController(
accelerator_controller_ = std::move(accelerator_controller);
}
+void WmShell::SessionStateChanged(session_manager::SessionState state) {
+ // Create the shelf when the first session becomes active. There's no need to
+ // recreate it when multiprofile sessions are added.
+ if (state != session_manager::SessionState::ACTIVE || first_session_active_)
+ return;
+
+ WmShell::Get()->CreateShelf();
msw 2016/12/20 15:37:30 Isn't WmShell::Get() equivalent to |this|, and not
James Cook 2016/12/20 17:27:19 Whoops, done.
+ first_session_active_ = true;
msw 2016/12/20 15:37:30 Should this ever be reset to false, eg. when the u
James Cook 2016/12/20 17:27:19 Changed to always attempt to create the shelf (whi
+}
+
} // namespace ash
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/mus/test/ash_test_impl_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698