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..038c7a5de05cf91a1aa60d569a2c006fa2c48d6b 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,13 @@ void TabDragController::CompleteDrag() { |
| if (attached_tabstrip_) { |
| if (is_dragging_new_browser_) { |
| +#if defined(USE_ASH) |
| + if (attached_tabstrip_->GetWidget()->GetNativeWindow()->parent()->id() == |
| + ash::internal::kShellWindowId_DockedContainer) { |
| + 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 +1892,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 (host_desktop_type_ == chrome::HOST_DESKTOP_TYPE_ASH && |
|
oshima
2013/10/25 16:12:32
I think this check isn't necessary as the paren'ts
varkha
2013/10/25 17:05:04
Done.
|
| + (was_source_fullscreen_ || was_source_maximized_) && |
| + (attached_tabstrip_->GetWidget()->GetNativeWindow()->parent()->id() == |
| + ash::internal::kShellWindowId_DockedContainer)) { |
| + attached_tabstrip_->GetWidget()->Restore(); |
| + } |
| +#endif |
| } |
| attached_tabstrip_->StoppedDraggingTabs( |
| GetTabsMatchingDraggedContents(attached_tabstrip_), |