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

Unified Diff: ash/wm/dock/docked_window_layout_manager.cc

Issue 121153003: Prevents panels attached to shelf from docking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prevents panels attached to shelf from docking (nits) Created 6 years, 11 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
« no previous file with comments | « ash/wm/default_window_resizer.cc ('k') | ash/wm/dock/docked_window_resizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/dock/docked_window_layout_manager.cc
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
index 0a648a025f748303a10c7c27d0f6a78dfeedee28..469659f3715450d4e41fd5409fd29f506cc0cab8 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -532,8 +532,12 @@ bool DockedWindowLayoutManager::CanDockWindow(aura::Window* window,
if (!switches::UseDockedWindows())
return false;
// Don't allow interactive docking of windows with transient parents such as
- // modal browser dialogs.
- if (IsPopupOrTransient(window))
+ // modal browser dialogs. Prevent docking of panels attached to shelf during
+ // the drag.
+ wm::WindowState* window_state = wm::GetWindowState(window);
+ bool should_attach_to_shelf = window_state->drag_details() &&
+ window_state->drag_details()->should_attach_to_shelf;
+ if (IsPopupOrTransient(window) || should_attach_to_shelf)
return false;
// If a window is wide and cannot be resized down to maximum width allowed
// then it cannot be docked.
@@ -541,7 +545,7 @@ bool DockedWindowLayoutManager::CanDockWindow(aura::Window* window,
// they are docked. The size will take effect only once a window is undocked.
// See http://crbug.com/307792.
if (window->bounds().width() > kMaxDockWidth &&
- (!wm::GetWindowState(window)->CanResize() ||
+ (!window_state->CanResize() ||
(window->delegate() &&
window->delegate()->GetMinimumSize().width() != 0 &&
window->delegate()->GetMinimumSize().width() > kMaxDockWidth))) {
« no previous file with comments | « ash/wm/default_window_resizer.cc ('k') | ash/wm/dock/docked_window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698