Chromium Code Reviews| Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc |
| diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
| index bb452ef74e862ee346469916b96e9bb59ec622df..83f064d29d90c1d87fcae8f611ae6d5d950eaf3c 100644 |
| --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
| +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
| @@ -63,6 +63,10 @@ |
| #include "ui/events/gestures/gesture_recognizer.h" |
| #endif |
| +#if defined(OS_CHROMEOS) |
| +#include "chrome/browser/ui/ash/multi_user_window_manager.h" |
| +#endif |
| + |
| using content::OpenURLParams; |
| using content::UserMetricsAction; |
| using content::WebContents; |
| @@ -251,7 +255,22 @@ class WindowPositionManagedUpdater : public views::WidgetObserver { |
| } |
| }; |
| -} // namespace |
| +// Being in the separate desktop multi profile mode, a visiting window from one |
| +// user should show all dragged off tabs on the current user's desktop. This |
| +// function transfers the visibility of a newly created browser accordingly. |
| +void MoveBrowserToCurrentUser(Browser* browser) { |
|
sky
2013/10/31 22:04:04
This feels wrong. Why do we have to special case e
|
| +#if defined(OS_CHROMEOS) |
| + if (chrome::MultiUserWindowManager::GetMultiProfileMode() == |
| + chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_SEPARATED) { |
| + chrome::MultiUserWindowManager* window_manager = |
| + chrome::MultiUserWindowManager::GetInstance(); |
| + window_manager->ShowWindowForUser(browser->window()->GetNativeWindow(), |
| + window_manager->current_user_id()); |
| + } |
| +#endif |
| +} |
| + |
| +} // namespace |
| /////////////////////////////////////////////////////////////////////////////// |
| // DockDisplayer |
| @@ -2001,6 +2020,8 @@ void TabDragController::CompleteDrag() { |
| GetModel(source_tabstrip_)->delegate()->CreateNewStripWithContents( |
| contentses, window_bounds, dock_info_, widget->IsMaximized()); |
| ResetSelection(new_browser->tab_strip_model()); |
| + // Make sure that the window is shown on the correct users desktop. |
| + MoveBrowserToCurrentUser(new_browser); |
| new_browser->window()->Show(); |
| // Return the WebContents to normalcy. |
| @@ -2262,6 +2283,9 @@ Browser* TabDragController::CreateBrowserForDrag( |
| host_desktop_type_); |
| create_params.initial_bounds = new_bounds; |
| Browser* browser = new Browser(create_params); |
| + // Make sure that the window is shown on the correct users desktop. |
| + MoveBrowserToCurrentUser(browser); |
| + |
| is_dragging_new_browser_ = true; |
| SetTrackedByWorkspace(browser->window()->GetNativeWindow(), false); |
| SetWindowPositionManaged(browser->window()->GetNativeWindow(), false); |