| Index: chrome/browser/ui/ash/multi_user_window_manager.cc
|
| diff --git a/chrome/browser/ui/ash/multi_user_window_manager.cc b/chrome/browser/ui/ash/multi_user_window_manager.cc
|
| index b54fdb74eea3dcf94e6a568d8f625744da5c4a9f..81ad014c649c6e55e3b978b8d31de3ee1caf290e 100644
|
| --- a/chrome/browser/ui/ash/multi_user_window_manager.cc
|
| +++ b/chrome/browser/ui/ash/multi_user_window_manager.cc
|
| @@ -168,6 +168,9 @@ void MultiUserWindowManager::SetWindowOwner(aura::Window* window,
|
| DCHECK(GetWindowOwner(window).empty());
|
| window_to_entry_[window] = new WindowEntry(user_id);
|
|
|
| + // Remember the initial visibility of the window.
|
| + window_to_entry_[window]->set_show(window->IsVisible());
|
| +
|
| // Set the window and the state observer.
|
| window->AddObserver(this);
|
| ash::wm::GetWindowState(window)->AddObserver(this);
|
| @@ -203,10 +206,13 @@ void MultiUserWindowManager::ShowWindowForUser(aura::Window* window,
|
| it->second->set_show_for_user(user_id);
|
|
|
| // Show the window if the added user is the current one.
|
| - if (user_id == current_user_id_)
|
| - SetWindowVisibility(window, true);
|
| - else
|
| + if (user_id == current_user_id_) {
|
| + // Only show the window if it should be shown according to its state.
|
| + if (it->second->show())
|
| + SetWindowVisibility(window, true);
|
| + } else {
|
| SetWindowVisibility(window, false);
|
| + }
|
| }
|
|
|
| bool MultiUserWindowManager::AreWindowsSharedAmongUsers() {
|
|
|