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

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: 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_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());
}

Powered by Google App Engine
This is Rietveld 408576698