| Index: chrome/browser/ui/browser_navigator.cc
|
| diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
|
| index f7714d42f7fde86c2987c6a939fedbce25dd32dd..cf6f21325e2c05e1603bac6ae932fce719657ea1 100644
|
| --- a/chrome/browser/ui/browser_navigator.cc
|
| +++ b/chrome/browser/ui/browser_navigator.cc
|
| @@ -39,7 +39,7 @@
|
| #include "extensions/features/features.h"
|
|
|
| #if defined(USE_ASH)
|
| -#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
|
| +#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
|
| #include "components/signin/core/account_id/account_id.h"
|
| #endif
|
|
|
| @@ -437,26 +437,10 @@ void Navigate(NavigateParams* params) {
|
| return;
|
|
|
| #if defined(USE_ASH)
|
| - if (source_browser && source_browser != params->browser) {
|
| - // When the newly created browser was spawned by a browser which visits
|
| - // another user's desktop, it should be shown on the same desktop as the
|
| - // originating one. (This is part of the desktop separation per profile).
|
| - MultiUserWindowManager* manager = MultiUserWindowManager::GetInstance();
|
| - // Some unit tests have no manager instantiated.
|
| - if (manager) {
|
| - aura::Window* src_window = source_browser->window()->GetNativeWindow();
|
| - aura::Window* new_window = params->browser->window()->GetNativeWindow();
|
| - const AccountId& src_account_id =
|
| - manager->GetUserPresentingWindow(src_window);
|
| - if (src_account_id != manager->GetUserPresentingWindow(new_window)) {
|
| - // Once the window gets presented, it should be shown on the same
|
| - // desktop as the desktop of the creating browser. Note that this
|
| - // command will not show the window if it wasn't shown yet by the
|
| - // browser creation.
|
| - manager->ShowWindowForUser(new_window, src_account_id);
|
| - }
|
| - }
|
| - }
|
| + // In ChromeOS multiprofile scenario we might need to teleport the window back
|
| + // to the current user desktop.
|
| + aura::Window* new_window = params->browser->window()->GetNativeWindow();
|
| + multi_user_util::MoveWindowToCurrentDesktop(new_window);
|
| #endif
|
|
|
| // Navigate() must not return early after this point.
|
|
|