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

Unified Diff: chrome/browser/ui/ash/multi_user/multi_user_util.cc

Issue 2644733004: Chrome OS: New window on teleported browser window should show on current desktop (Closed)
Patch Set: remove unused include Created 3 years, 11 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/multi_user_util.cc
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_util.cc b/chrome/browser/ui/ash/multi_user/multi_user_util.cc
index b00fb431f9193e349d4059bf40cb5674e91524f2..c204fb45788f00b8977867ee09315c002dbbdcc3 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_util.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_util.cc
@@ -59,11 +59,15 @@ const AccountId GetCurrentAccountId() {
// Move the window to the current user's desktop.
void MoveWindowToCurrentDesktop(aura::Window* window) {
- if (!chrome::MultiUserWindowManager::GetInstance()->IsWindowOnDesktopOfUser(
- window, GetCurrentAccountId())) {
- chrome::MultiUserWindowManager::GetInstance()->ShowWindowForUser(
- window, GetCurrentAccountId());
- }
+ chrome::MultiUserWindowManager* manager =
+ chrome::MultiUserWindowManager::GetInstance();
+
+ // Some unit tests have no manager instantiated.
+ if (!manager)
+ return;
+
+ if (!manager->IsWindowOnDesktopOfUser(window, GetCurrentAccountId()))
+ manager->ShowWindowForUser(window, GetCurrentAccountId());
}
} // namespace multi_user_util

Powered by Google App Engine
This is Rietveld 408576698