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

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

Issue 10444014: ash: Improved window maximize/restore animations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix lock screen, app windows Created 8 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_manager.h ('k') | 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 d4eda81dc4a669c9e6d2d4d708c931527a13ad55..c50fc84c7a49ce558921585da2d1a0be64d9e942 100644
--- a/ash/wm/workspace/workspace_manager.cc
+++ b/ash/wm/workspace/workspace_manager.cc
@@ -30,13 +30,17 @@
namespace {
-// Returns a list of all the windows with layers in |result|.
+// Returns a list of all the windows with layers in |result|. Optionally
+// ignores the window |ignore_window|.
void BuildWindowList(const std::vector<aura::Window*>& windows,
+ aura::Window* ignore_window,
std::vector<aura::Window*>* result) {
for (size_t i = 0; i < windows.size(); ++i) {
+ if (windows[i] == ignore_window)
+ continue;
if (windows[i]->layer())
result->push_back(windows[i]);
- BuildWindowList(windows[i]->transient_children(), result);
+ BuildWindowList(windows[i]->transient_children(), ignore_window, result);
}
}
@@ -51,7 +55,7 @@ namespace internal {
WorkspaceManager::WorkspaceManager(aura::Window* contents_view)
: contents_view_(contents_view),
active_workspace_(NULL),
- ignored_window_(NULL),
+ maximize_restore_window_(NULL),
grid_size_(0),
shelf_(NULL) {
DCHECK(contents_view);
@@ -212,7 +216,7 @@ void WorkspaceManager::SetVisibilityOfWorkspaceWindows(
AnimateChangeType change_type,
bool value) {
std::vector<aura::Window*> children;
- BuildWindowList(workspace->windows(), &children);
+ BuildWindowList(workspace->windows(), maximize_restore_window_, &children);
SetWindowLayerVisibility(children, change_type, value);
}
@@ -289,9 +293,7 @@ int WorkspaceManager::GetWorkspaceIndexContaining(aura::Window* window) const {
void WorkspaceManager::SetWindowBounds(aura::Window* window,
const gfx::Rect& bounds) {
- ignored_window_ = window;
window->SetBounds(bounds);
- ignored_window_ = NULL;
}
void WorkspaceManager::OnTypeOfWorkspacedNeededChanged(aura::Window* window) {
@@ -312,7 +314,9 @@ void WorkspaceManager::OnTypeOfWorkspacedNeededChanged(aura::Window* window) {
new_workspace = CreateWorkspace(Workspace::TYPE_MANAGED);
new_workspace->AddWindowAfter(window, NULL);
}
+ maximize_restore_window_ = window;
SetActiveWorkspace(new_workspace);
+ maximize_restore_window_ = NULL;
// Delete at the end so that we don't attempt to switch to another
// workspace in RemoveWorkspace().
CleanupWorkspace(current_workspace);
« no previous file with comments | « ash/wm/workspace/workspace_manager.h ('k') | ash/wm/workspace/workspace_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698