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

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: Don't append teleport window context menu item for delicated settings window. 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..11ae08ef671499f450dbfa442074bd3f1cdf473e 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,10 @@
#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"
+#endif
+
ChromeLauncherAppMenuItemTab::ChromeLauncherAppMenuItemTab(
const base::string16 title,
const gfx::Image* icon,
@@ -43,6 +47,20 @@ 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();
+ 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:45 You need to add {} around this since it's more the
+ window_manager->ShowWindowForUser(
+ window, window_manager->GetWindowOwner(window));
+ }
+#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