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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.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_tab.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc
index b1ce6d6d3ca34b2ca2e68cbeb8a3693ee46ed11f..b9b28176536dd13496ddec851e951cf81020d0fd 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc
@@ -11,6 +11,11 @@
#include "chrome/browser/ui/tabs/tab_strip_model.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
+
ChromeLauncherAppMenuItemTab::ChromeLauncherAppMenuItemTab(
const base::string16 title,
const gfx::Image* icon,
@@ -43,6 +48,22 @@ void ChromeLauncherAppMenuItemTab::Execute(int event_flags) {
if (event_flags & (ui::EF_SHIFT_DOWN | ui::EF_MIDDLE_MOUSE_BUTTON)) {
tab_strip->CloseWebContentsAt(index, TabStripModel::CLOSE_USER_GESTURE);
} else {
+#if defined(OS_CHROMEOS)
+ // In 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();
Mr4D (OOO till 08-26) 2015/04/30 21:51:44 You could avoid using the user manager by checking
xdai1 2015/05/01 18:28:23 Done.
+ if (!window_manager->IsWindowOnDesktopOfUser(window, current_user))
+ window_manager->ShowWindowForUser(window, current_user);
+ }
+#endif
tab_strip->ActivateTabAt(index, false);
browser->window()->Show();
// Need this check to prevent unit tests from crashing.

Powered by Google App Engine
This is Rietveld 408576698