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

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: Add docked window states 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..fd431e9bc4f73498eadaa6955609f6a9870f4033 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() &&
+ !window_state_->IsNormalStateType())
is_docked_ = false;
// When drag is completed the dragged docked window is resized to the bounds
@@ -243,6 +245,16 @@ void DockedWindowResizer::FinishedDragging(
window_state_->SetRestoreBoundsInScreen(restore_bounds);
}
+ if (move_result != aura::client::MOVE_CANCELED && is_docked_ != was_docked_) {
+ if (is_docked_) {
+ const wm::WMEvent event(wm::WM_EVENT_DOCK);
+ window_state_->OnWMEvent(&event);
+ } else if (window_state_->IsDocked()) {
+ const wm::WMEvent event(wm::WM_EVENT_NORMAL);
+ window_state_->OnWMEvent(&event);
+ }
+ }
+
// Check if the window needs to be docked or returned to workspace.
DockedAction action = MaybeReparentWindowOnDragCompletion(is_resized,
is_attached_panel);
varkha 2014/09/25 22:09:28 There is still an outstanding comment here about M
dtapuska 2014/09/26 14:17:07 I moved the code around; so the event sending is i

Powered by Google App Engine
This is Rietveld 408576698