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

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 (nits) 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..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_),
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698