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 8462a63e4b82b80caade1fe7fb4c5cfdb4ed2ea5..5e5d4bab8eb96e62f17a8ca951f6f5e976c3a9b9 100644 |
| --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
| +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
| @@ -52,6 +52,7 @@ |
| #if defined(USE_ASH) |
| #include "ash/shell.h" |
| #include "ash/shell_delegate.h" |
| +#include "ash/shell_window_ids.h" |
| #include "ash/wm/coordinate_conversion.h" |
| #include "ash/wm/window_state.h" |
| #include "ui/aura/env.h" |
| @@ -1873,6 +1874,14 @@ void TabDragController::CompleteDrag() { |
| if (attached_tabstrip_) { |
| if (is_dragging_new_browser_) { |
| +#if defined(USE_ASH) |
| + if (attached_tabstrip_->GetWidget()->GetNativeWindow()->parent()->id() == |
|
sky
2013/10/28 14:30:08
Is there a way for these ifdefs to be moved closed
varkha
2013/10/29 03:08:25
I looked into what it would take to move the ash-s
|
| + ash::internal::kShellWindowId_DockedContainer) { |
| + DCHECK_EQ(host_desktop_type_, chrome::HOST_DESKTOP_TYPE_ASH); |
| + was_source_maximized_ = false; |
| + was_source_fullscreen_ = false; |
| + } |
| +#endif |
| // If source window was maximized - maximize the new window as well. |
| if (was_source_maximized_) |
| attached_tabstrip_->GetWidget()->Maximize(); |
| @@ -1884,6 +1893,17 @@ void TabDragController::CompleteDrag() { |
| ash::Shell::GetInstance()->delegate()->ToggleFullscreen(); |
| } |
| #endif |
| + } else { |
| +#if defined(USE_ASH) |
| + // When dragging results in maximized or fullscreen browser window getting |
| + // docked, restore it. |
| + if ((was_source_fullscreen_ || was_source_maximized_) && |
| + (attached_tabstrip_->GetWidget()->GetNativeWindow()->parent()->id() == |
| + ash::internal::kShellWindowId_DockedContainer)) { |
| + DCHECK_EQ(host_desktop_type_, chrome::HOST_DESKTOP_TYPE_ASH); |
| + attached_tabstrip_->GetWidget()->Restore(); |
| + } |
| +#endif |
| } |
| attached_tabstrip_->StoppedDraggingTabs( |
| GetTabsMatchingDraggedContents(attached_tabstrip_), |