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 0b48e712542b09efa7c1b3bc54b65cbf6a85d841..44e068b9114699960601d47446f115c40605322f 100644 |
| --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
| +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
| @@ -47,6 +47,7 @@ |
| #if defined(USE_ASH) |
| #include "ash/shell.h" |
| #include "ash/wm/property_util.h" |
| +#include "ash/wm/window_util.h" |
| #include "ui/aura/env.h" |
| #include "ui/aura/root_window.h" |
| #include "ui/base/gestures/gesture_recognizer.h" |
| @@ -828,6 +829,16 @@ TabDragController::DragBrowserToNewTabStrip( |
| browser_widget->ReleaseCapture(); |
| #else |
| target_tabstrip->GetWidget()->SetCapture(attached_tabstrip_); |
| + // To avoid the auto window management to kick in we set the user changed |
|
sky
2012/10/23 19:35:39
What we're saying is that when you drag a window a
Mr4D (OOO till 08-26)
2012/10/24 16:41:37
Done indirectly as requested.
|
| + // flag. Note that the browser might only have a single tab left at this |
| + // point and if that happens it will be destroyed shortly after in which |
| + // case we don't want to ever take back the flag. |
| + bool old_state = true; |
| + if (GetModel(attached_tabstrip_)->count() > 1) |
| + old_state = ash::wm::HasUserChangedWindowPositionOrSize( |
| + browser_widget->GetNativeWindow()); |
| + ash::wm::SetUserHasChangedWindowPositionOrSize( |
| + browser_widget->GetNativeWindow(), true); |
| #endif |
| // EndMoveLoop is going to snap the window back to its original location. |
| // Hide it so users don't see this. |
| @@ -840,6 +851,9 @@ TabDragController::DragBrowserToNewTabStrip( |
| // after the loop completes. But on chromeos, we can do tab swapping now to |
| // avoid the tab flashing issue(crbug.com/116329). |
| #if defined(USE_ASH) |
| + if (!old_state) |
| + ash::wm::SetUserHasChangedWindowPositionOrSize( |
| + browser_widget->GetNativeWindow(), old_state); |
| is_dragging_window_ = false; |
| Detach(DONT_RELEASE_CAPTURE); |
| Attach(target_tabstrip, point_in_screen); |
| @@ -1308,7 +1322,7 @@ void TabDragController::DetachIntoNewBrowserAndRunMoveLoop( |
| void TabDragController::RunMoveLoop(const gfx::Point& drag_offset) { |
| // If the user drags the whole window we'll assume they are going to attach to |
| - // another window and therefor want to reorder. |
| + // another window and therefore want to reorder. |
| move_behavior_ = REORDER; |
| move_loop_widget_ = GetAttachedBrowserWidget(); |