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

Unified Diff: chrome/browser/ui/ash/multi_user_window_manager.cc

Issue 55303003: Fixing drag and drop visibility issues of tabs on a visiting desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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: 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() {

Powered by Google App Engine
This is Rietveld 408576698