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

Side by Side Diff: ui/aura_shell/workspace/workspace.cc

Issue 8362006: Reland r107720 - Enable the new layer animation framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura_shell/workspace/workspace.h" 5 #include "ui/aura_shell/workspace/workspace.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura_shell/workspace/workspace_manager.h" 9 #include "ui/aura_shell/workspace/workspace_manager.h"
10 #include "ui/gfx/compositor/layer.h" 10 #include "ui/gfx/compositor/layer.h"
11 #include "ui/gfx/compositor/layer_animator.h"
11 12
12 namespace { 13 namespace {
13 // Horizontal margin between windows. 14 // Horizontal margin between windows.
14 const int kWindowHorizontalMargin = 10; 15 const int kWindowHorizontalMargin = 10;
15 } 16 }
16 17
17 namespace aura_shell { 18 namespace aura_shell {
18 19
19 Workspace::Workspace(WorkspaceManager* manager) 20 Workspace::Workspace(WorkspaceManager* manager)
20 : workspace_manager_(manager) { 21 : workspace_manager_(manager) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 aura::Window* window, 123 aura::Window* window,
123 const gfx::Point& origin, 124 const gfx::Point& origin,
124 bool animate) { 125 bool animate) {
125 if (window->show_state() == ui::SHOW_STATE_FULLSCREEN) 126 if (window->show_state() == ui::SHOW_STATE_FULLSCREEN)
126 window->Fullscreen(); 127 window->Fullscreen();
127 else if (window->show_state() == ui::SHOW_STATE_MAXIMIZED) 128 else if (window->show_state() == ui::SHOW_STATE_MAXIMIZED)
128 window->Maximize(); 129 window->Maximize();
129 else { 130 else {
130 gfx::Rect bounds = window->GetTargetBounds(); 131 gfx::Rect bounds = window->GetTargetBounds();
131 bounds.set_origin(origin); 132 bounds.set_origin(origin);
132 if (animate) 133 if (animate) {
133 window->layer()->SetAnimation(aura::Window::CreateDefaultAnimation()); 134 aura::Window::ScopedAnimationSettings settings(
134 window->SetBounds(bounds); 135 window->layer()->GetAnimator());
136 window->SetBounds(bounds);
137 } else {
138 window->SetBounds(bounds);
139 }
135 } 140 }
136 } 141 }
137 142
138 } // namespace aura_shell 143 } // namespace aura_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698