Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3501)

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 38073004: Not moving a docked window when restoring a previously maximized window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Not moving a docked window when restoring a previously maximized window (delegating IsDocked to non… Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_),

Powered by Google App Engine
This is Rietveld 408576698