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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc

Issue 1109393011: Pull back windows to the original user desktop when clicking on the correspond window list bubble i… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/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..a9de380f8d838b0d13f64c1bb9fb93263094276e 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,11 @@
#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"
+#include "components/user_manager/user_manager.h"
+#endif
+
ChromeLauncherAppMenuItemBrowser::ChromeLauncherAppMenuItemBrowser(
const base::string16 title,
const gfx::Image* icon,
@@ -42,6 +47,22 @@ 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) {
+ aura::Window* window = browser_->window()->GetNativeWindow();
+ const user_manager::UserManager* user_manager =
+ user_manager::UserManager::Get();
+ const std::string& current_user =
+ user_manager->GetActiveUser()->GetUserID();
+ chrome::MultiUserWindowManager* window_manager =
+ chrome::MultiUserWindowManager::GetInstance();
+ if (!window_manager->IsWindowOnDesktopOfUser(window, current_user))
+ window_manager->ShowWindowForUser(window, current_user);
+ }
+#endif
browser_->window()->Show();
ash::wm::ActivateWindow(browser_->window()->GetNativeWindow());
}

Powered by Google App Engine
This is Rietveld 408576698