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

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

Issue 16093036: Do not create a workspace for a maximized window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test failure Created 7 years, 6 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 | « ash/wm/workspace/workspace.cc ('k') | ash/wm/workspace/workspace_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ed0a913f49c6117bce4d755adfe47585f3beb80f 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -74,6 +74,11 @@ void ResetConstrainedWindowBoundsIfNecessary(const BoundsMap& bounds_map,
ResetConstrainedWindowBoundsIfNecessary(bounds_map, window->children()[i]);
}
+bool IsMaximizedState(ui::WindowShowState state) {
+ return state == ui::SHOW_STATE_MAXIMIZED ||
+ state == ui::SHOW_STATE_FULLSCREEN;
+}
+
} // namespace
WorkspaceLayoutManager::WorkspaceLayoutManager(Workspace* workspace)
@@ -176,8 +181,8 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
window->GetProperty(aura::client::kShowStateKey);
if (old_state != ui::SHOW_STATE_MINIMIZED &&
GetRestoreBoundsInScreen(window) == NULL &&
- WorkspaceManager::IsMaximizedState(new_state) &&
- !WorkspaceManager::IsMaximizedState(old_state)) {
+ IsMaximizedState(new_state) &&
+ !IsMaximizedState(old_state)) {
SetRestoreBoundsInParent(window, window->bounds());
}
// When restoring from a minimized state, we want to restore to the
@@ -194,17 +199,18 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
SetRestoreBoundsInScreen(window, window->GetBoundsInScreen());
}
- // If maximizing or restoring, clone the layer. WorkspaceManager will use it
- // (and take ownership of it) when animating. Ideally we could use that of
- // BaseLayoutManager, but that proves problematic. In particular when
- // restoring we need to animate on top of the workspace animating in.
+ // If the new state requires |window| to be in a workspace, clone the layer.
+ // WorkspaceManager will use it (and take ownership of it) when animating.
+ // Ideally we could use that of BaseLayoutManager, but that proves
+ // problematic. In particular when restoring we need to animate on top of
+ // the workspace animating in.
ui::Layer* cloned_layer = NULL;
BoundsMap bounds_map;
if (wm::IsActiveWindow(window) &&
- ((WorkspaceManager::IsMaximizedState(new_state) &&
+ ((new_state == ui::SHOW_STATE_FULLSCREEN &&
wm::IsWindowStateNormal(old_state)) ||
- (!WorkspaceManager::IsMaximizedState(new_state) &&
- WorkspaceManager::IsMaximizedState(old_state) &&
+ (new_state != ui::SHOW_STATE_FULLSCREEN &&
+ old_state == ui::SHOW_STATE_FULLSCREEN &&
new_state != ui::SHOW_STATE_MINIMIZED))) {
BuildWindowBoundsMap(window, &bounds_map);
cloned_layer = views::corewm::RecreateWindowLayers(window, false);
@@ -232,6 +238,11 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
if (key == internal::kWindowTrackedByWorkspaceKey &&
GetTrackedByWorkspace(window)) {
workspace_manager()->OnTrackedByWorkspaceChanged(workspace_, window);
+ if (wm::IsWindowMaximized(window)) {
+ SetChildBoundsDirect(
+ window, ScreenAsh::GetMaximizedWindowBoundsInParent(
+ window->parent()->parent()));
+ }
}
if (key == aura::client::kAlwaysOnTopKey &&
« no previous file with comments | « ash/wm/workspace/workspace.cc ('k') | ash/wm/workspace/workspace_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698