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

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

Issue 10984032: Makes wm2 reset the bounds immediately after cloning the layer for (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_view_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_layout_manager2.cc
diff --git a/ash/wm/workspace/workspace_layout_manager2.cc b/ash/wm/workspace/workspace_layout_manager2.cc
index 45a58025444673b769e2510a2e94f30eb27bd2e4..8f966f77a5fada505b325b2535062afde0e26939 100644
--- a/ash/wm/workspace/workspace_layout_manager2.cc
+++ b/ash/wm/workspace/workspace_layout_manager2.cc
@@ -53,6 +53,20 @@ void ResetBoundsIfNecessary(const BoundsMap& bounds_map, aura::Window* window) {
ResetBoundsIfNecessary(bounds_map, window->children()[i]);
}
+// Resets |window|s bounds from |bounds_map| if |window| is marked as a
+// constrained window. Recusively invokes this for all children.
+// TODO(sky): this should key off window type.
+void ResetConstrainedWindowBoundsIfNecessary(const BoundsMap& bounds_map,
+ aura::Window* window) {
+ if (window->GetProperty(aura::client::kConstrainedWindowKey)) {
+ BoundsMap::const_iterator i = bounds_map.find(window);
Mr4D (OOO till 08-26) 2012/09/26 04:25:08 It is a bit confusing to have to 'i' variables in
sky 2012/09/26 04:51:15 They have totally different scopes. It's no differ
+ if (i != bounds_map.end())
+ window->SetBounds(i->second);
+ }
+ for (size_t i = 0; i < window->children().size(); ++i)
+ ResetConstrainedWindowBoundsIfNecessary(bounds_map, window->children()[i]);
+}
+
} // namespace
WorkspaceLayoutManager2::WorkspaceLayoutManager2(Workspace2* workspace)
@@ -176,6 +190,9 @@ void WorkspaceLayoutManager2::OnWindowPropertyChanged(Window* window,
new_state != ui::SHOW_STATE_MINIMIZED))) {
BuildWindowBoundsMap(window, &bounds_map);
cloned_layer = wm::RecreateWindowLayers(window, false);
+ // Constrained windows don't get their bounds reset when we update the
+ // window bounds. Leaving them empty is unexpected, so we reset them now.
+ ResetConstrainedWindowBoundsIfNecessary(bounds_map, window);
}
UpdateBoundsFromShowState(window);
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698