Index: chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc |
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc |
index 26a75a8b145797767ae31c043b036c78eae39ace..042fe39bc6c337208ae060909237cf39b13e3ddf 100644 |
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc |
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc |
@@ -13,6 +13,10 @@ |
#include "content/public/browser/notification_service.h" |
#include "ui/events/event_constants.h" |
+#if defined(OS_CHROMEOS) |
+#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
+#endif |
+ |
ChromeLauncherAppMenuItemBrowser::ChromeLauncherAppMenuItemBrowser( |
const base::string16 title, |
const gfx::Image* icon, |
@@ -42,6 +46,20 @@ void ChromeLauncherAppMenuItemBrowser::Execute(int event_flags) { |
TabStripModel* tab_strip = browser_->tab_strip_model(); |
tab_strip->CloseAllTabs(); |
} else { |
+#if defined(OS_CHROMEOS) |
+ // In ChromeOS multiprofile scenario we might need to teleport the window |
+ // back to the current user desktop. |
+ if (chrome::MultiUserWindowManager::GetMultiProfileMode() == |
+ chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_SEPARATED) { |
Mr4D (OOO till 08-26)
2015/05/03 19:53:44
Since this is the same code as in the other cc mod
xdai1
2015/05/04 16:54:56
Found an existing function... Used it instead.
|
+ aura::Window* window = browser_->window()->GetNativeWindow(); |
+ chrome::MultiUserWindowManager* window_manager = |
+ chrome::MultiUserWindowManager::GetInstance(); |
+ if (!window_manager->IsWindowOnDesktopOfUser( |
+ window, window_manager->GetWindowOwner(window))) |
Mr4D (OOO till 08-26)
2015/05/03 19:53:44
same here
|
+ window_manager->ShowWindowForUser( |
+ window, window_manager->GetWindowOwner(window)); |
+ } |
+#endif |
browser_->window()->Show(); |
ash::wm::ActivateWindow(browser_->window()->GetNativeWindow()); |
} |