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 8462a63e4b82b80caade1fe7fb4c5cfdb4ed2ea5..83f404f2ffc7c72852ec04677ff132aa4d79b395 100644 |
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
@@ -1873,6 +1873,11 @@ void TabDragController::CompleteDrag() { |
if (attached_tabstrip_) { |
if (is_dragging_new_browser_) { |
+ if (attached_tabstrip_->GetWidget()->IsDocked()) { |
+ DCHECK_EQ(host_desktop_type_, chrome::HOST_DESKTOP_TYPE_ASH); |
+ was_source_maximized_ = false; |
+ was_source_fullscreen_ = false; |
+ } |
// If source window was maximized - maximize the new window as well. |
if (was_source_maximized_) |
attached_tabstrip_->GetWidget()->Maximize(); |
@@ -1884,6 +1889,14 @@ void TabDragController::CompleteDrag() { |
ash::Shell::GetInstance()->delegate()->ToggleFullscreen(); |
} |
#endif |
+ } else { |
+ // When dragging results in maximized or fullscreen browser window getting |
+ // docked, restore it. |
+ if ((was_source_fullscreen_ || was_source_maximized_) && |
+ (attached_tabstrip_->GetWidget()->IsDocked())) { |
+ DCHECK_EQ(host_desktop_type_, chrome::HOST_DESKTOP_TYPE_ASH); |
+ attached_tabstrip_->GetWidget()->Restore(); |
+ } |
} |
attached_tabstrip_->StoppedDraggingTabs( |
GetTabsMatchingDraggedContents(attached_tabstrip_), |