Index: ash/common/wm_shell.cc |
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc |
index 7f4f6838c81b86ac8ba0a2454a7f6970164a5456..932fe6a9359b5128d3fdabc6fcdd3e01ce806e7d 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,12 @@ void WmShell::SetAcceleratorController( |
accelerator_controller_ = std::move(accelerator_controller); |
} |
+// SessionStateObserver: |
+ |
+void WmShell::SessionStateChanged(session_manager::SessionState state) { |
+ // NOTE: This occurs more than once if the user adds a secondary account. |
+ if (state == session_manager::SessionState::ACTIVE) |
+ OnUserSessionStateActive(); |
+} |
+ |
} // namespace ash |