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

Unified Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Docking with dock width=0 Created 7 years, 7 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/workspace/workspace_layout_manager.cc
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index e4e6c841e0208d8856a54a0cd53a6853d8c3128b..4a1c02e442ed4c6f8841bc7a3db6ac08135f7707 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -8,6 +8,7 @@
#include "ash/screen_ash.h"
#include "ash/session_state_delegate.h"
#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "ash/wm/always_on_top_controller.h"
#include "ash/wm/base_layout_manager.h"
#include "ash/wm/window_animations.h"
@@ -48,7 +49,7 @@ void BuildWindowBoundsMap(const aura::Window* window, BoundsMap* bounds_map) {
BuildWindowBoundsMap(window->children()[i], bounds_map);
}
-// Resets |window|s bounds from |bounds_map| if currently empty. Recusively
+// Resets |window|s bounds from |bounds_map| if currently empty. Recursively
// invokes this for all children.
void ResetBoundsIfNecessary(const BoundsMap& bounds_map, aura::Window* window) {
if (window->bounds().IsEmpty() && window->GetTargetBounds().IsEmpty()) {
@@ -61,7 +62,7 @@ void ResetBoundsIfNecessary(const BoundsMap& bounds_map, aura::Window* window) {
}
// Resets |window|s bounds from |bounds_map| if |window| is marked as a
-// constrained window. Recusively invokes this for all children.
+// constrained window. Recursively invokes this for all children.
// TODO(sky): this should key off window type.
void ResetConstrainedWindowBoundsIfNecessary(const BoundsMap& bounds_map,
aura::Window* window) {
@@ -241,6 +242,16 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
internal::kAlwaysOnTopControllerKey);
controller->GetContainer(window)->AddChild(window);
}
+
+ if (key == ash::internal::kDockEdge &&
+ GetDockEdge(window) != DOCK_EDGE_NONE &&
+ static_cast<DockEdge>(old) == DOCK_EDGE_NONE) {
+ aura::Window* dock_container = ash::Shell::GetContainer(
+ root_window_,
+ ash::internal::kShellWindowId_DockContainer);
+ DCHECK(dock_container);
+ dock_container->AddChild(window);
+ }
}
void WorkspaceLayoutManager::OnWindowDestroying(aura::Window* window) {

Powered by Google App Engine
This is Rietveld 408576698