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

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

Issue 10830029: Makes maximized windows go in their own workspace regardless of (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | ash/wm/workspace/workspace_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_manager.cc
diff --git a/ash/wm/workspace/workspace_manager.cc b/ash/wm/workspace/workspace_manager.cc
index d4ab3cbf24b98aa5d9e3e4c74040475d349849a7..fd5f66e8ef676f755d65b2971a2fac7c2f36502e 100644
--- a/ash/wm/workspace/workspace_manager.cc
+++ b/ash/wm/workspace/workspace_manager.cc
@@ -71,7 +71,8 @@ bool WorkspaceManager::ShouldManageWindow(aura::Window* window) {
return window->type() == aura::client::WINDOW_TYPE_NORMAL &&
!window->transient_parent() &&
ash::GetTrackedByWorkspace(window) &&
- !ash::GetPersistsAcrossAllWorkspaces(window);
+ (!ash::GetPersistsAcrossAllWorkspaces(window) ||
+ wm::IsWindowMaximized(window));
}
bool WorkspaceManager::Contains(aura::Window* window) const {
@@ -170,13 +171,17 @@ WorkspaceManager::WindowState WorkspaceManager::GetWindowState() {
}
void WorkspaceManager::ShowStateChanged(aura::Window* window) {
- if (!ShouldManageWindow(window) || !FindBy(window))
+ Workspace* workspace = FindBy(window);
+ if (!workspace)
return;
-
- Workspace::Type old_type = FindBy(window)->type();
- Workspace::Type new_type = Workspace::TypeForWindow(window);
- if (new_type != old_type)
- OnTypeOfWorkspacedNeededChanged(window);
+ if (!ShouldManageWindow(window)) {
+ RemoveWindow(window);
+ } else {
+ Workspace::Type old_type = workspace->type();
+ Workspace::Type new_type = Workspace::TypeForWindow(window);
+ if (new_type != old_type)
+ OnTypeOfWorkspacedNeededChanged(window);
+ }
UpdateShelfVisibility();
}
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698