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

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

Issue 594383002: Change behaviour of the Alt-] and Alt-[ keys so that it cycles through SnapLeft/SnapRight to DockLe… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@event
Patch Set: Address varkha's comments in #8 Created 6 years, 3 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: ash/wm/dock/docked_window_resizer.cc
diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc
index d0b86f9aed60fe4e2442806684c3b805e8e761b5..eef01743a81eda73b0bab5dfcfeb456077981afa 100644
--- a/ash/wm/dock/docked_window_resizer.cc
+++ b/ash/wm/dock/docked_window_resizer.cc
@@ -198,12 +198,7 @@ void DockedWindowResizer::StartedDragging() {
GetTarget()->parent()->id() == kShellWindowId_DefaultContainer) {
// Reparent the window into the docked windows container in order to get it
// on top of other docked windows.
- aura::Window* docked_container = Shell::GetContainer(
- GetTarget()->GetRootWindow(),
- kShellWindowId_DockedContainer);
- wm::ReparentChildWithTransientChildren(GetTarget(),
- GetTarget()->parent(),
- docked_container);
+ wm::DockWindow(GetTarget());
}
if (is_docked_)
dock_layout_->DockDraggedWindow(GetTarget());
@@ -270,15 +265,11 @@ DockedAction DockedWindowResizer::MaybeReparentWindowOnDragCompletion(
// Check if the window needs to be docked or returned to workspace.
DockedAction action = DOCKED_ACTION_NONE;
- aura::Window* dock_container = Shell::GetContainer(
- window->GetRootWindow(),
- kShellWindowId_DockedContainer);
if ((is_resized || !is_attached_panel) &&
- is_docked_ != (window->parent() == dock_container)) {
+ is_docked_ != (window->parent()->id() ==
+ kShellWindowId_DockedContainer)) {
if (is_docked_) {
- wm::ReparentChildWithTransientChildren(window,
- window->parent(),
- dock_container);
+ wm::DockWindow(window);
action = DOCKED_ACTION_DOCK;
} else if (window->parent()->id() == kShellWindowId_DockedContainer) {
// Reparent the window back to workspace.

Powered by Google App Engine
This is Rietveld 408576698