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

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

Issue 597683003: Add window states docked; and docked minimized. Add wm window event to set docked and undocked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dock
Patch Set: Address Restore of App Windows and DockLeft/Dock Right issues 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 14b58d408fe53eb12eca8c96538a33b537877fe6..1a32a198b7d52f6a52ba73cc0dcfcb53e6d462b9 100644
--- a/ash/wm/dock/docked_window_resizer.cc
+++ b/ash/wm/dock/docked_window_resizer.cc
@@ -15,6 +15,7 @@
#include "ash/wm/dock/docked_window_layout_manager.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
+#include "ash/wm/wm_event.h"
#include "ash/wm/workspace/magnetism_matcher.h"
#include "ash/wm/workspace/workspace_window_resizer.h"
#include "base/command_line.h"
@@ -222,7 +223,8 @@ void DockedWindowResizer::FinishedDragging(
// Undock the window if it is not in the normal or minimized state type. This
// happens if a user snaps or maximizes a window using a keyboard shortcut
// while it is being dragged.
- if (!window_state_->IsMinimized() && !window_state_->IsNormalStateType())
+ if (!window_state_->IsMinimized() && !window_state_->IsDocked() &&
varkha 2014/09/29 18:59:28 Can you comment why this change is necessary?
dtapuska 2014/09/29 20:59:57 Previously docked windows were normal state type w
+ !window_state_->IsNormalStateType())
is_docked_ = false;
// When drag is completed the dragged docked window is resized to the bounds
@@ -315,6 +317,16 @@ DockedAction DockedWindowResizer::MaybeReparentWindowOnDragCompletion(
wm::GetWindowState(window)->set_bounds_changed_by_user(
was_docked_ && (is_resized || was_bounds_changed_by_user_));
}
+
+ if (action == DOCKED_ACTION_DOCK) {
+ const wm::WMEvent event(wm::WM_EVENT_DOCK);
+ window_state_->OnWMEvent(&event);
+ } else if (wm::GetWindowState(window)->IsDocked() &&
+ action == DOCKED_ACTION_UNDOCK) {
+ const wm::WMEvent event(wm::WM_EVENT_NORMAL);
+ window_state_->OnWMEvent(&event);
+ }
+
return action;
}

Powered by Google App Engine
This is Rietveld 408576698