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

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

Issue 46893003: Undock window when reverting a drag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undock window when reverting a drag Created 7 years, 1 month 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 | « no previous file | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28d043848b298463ceae29a7f7289faed357b3df..0dd4aed8d9784378bf27770f538fc4b7693e79f9 100644
--- a/ash/wm/dock/docked_window_resizer.cc
+++ b/ash/wm/dock/docked_window_resizer.cc
@@ -4,7 +4,6 @@
#include "ash/wm/dock/docked_window_resizer.h"
-#include "ash/ash_switches.h"
#include "ash/display/display_controller.h"
#include "ash/launcher/launcher.h"
#include "ash/root_window_controller.h"
@@ -142,9 +141,12 @@ void DockedWindowResizer::RevertDrag() {
window_state->SetTrackedByWorkspace(false);
next_window_resizer_->RevertDrag();
// Restore docked state to what it was before the drag if necessary.
- if (was_docked_ && !is_docked_) {
- dock_layout_->DockDraggedWindow(GetTarget());
+ if (is_docked_ != was_docked_) {
is_docked_ = was_docked_;
+ if (is_docked_)
+ dock_layout_->DockDraggedWindow(GetTarget());
+ else
+ dock_layout_->UndockDraggedWindow();
}
FinishedDragging();
window_state->SetTrackedByWorkspace(was_tracked_by_workspace);
« no previous file with comments | « no previous file | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698