| OLD | NEW |
| 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 #include "ui/aura_shell/workspace/workspace_manager.h" | 4 #include "ui/aura_shell/workspace/workspace_manager.h" |
| 5 | 5 |
| 6 #include <algorithm> | 6 #include <algorithm> |
| 7 | 7 |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "ui/aura/desktop.h" | 9 #include "ui/aura/desktop.h" |
| 10 #include "ui/aura/screen_aura.h" | 10 #include "ui/aura/screen_aura.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 dx = workspace_size_.width() / 2 - active_workspace_mid_x; | 124 dx = workspace_size_.width() / 2 - active_workspace_mid_x; |
| 125 dx = std::min(0, std::max(dx, workspace_size_.width() - overview_width)); | 125 dx = std::min(0, std::max(dx, workspace_size_.width() - overview_width)); |
| 126 } | 126 } |
| 127 | 127 |
| 128 transform.SetTranslateX(dx); | 128 transform.SetTranslateX(dx); |
| 129 transform.SetTranslateY(workspace_size_.height() * (1.0f - scale) / 2); | 129 transform.SetTranslateY(workspace_size_.height() * (1.0f - scale) / 2); |
| 130 } else if (active_workspace_) { | 130 } else if (active_workspace_) { |
| 131 transform.SetTranslateX(-active_workspace_->bounds().x()); | 131 transform.SetTranslateX(-active_workspace_->bounds().x()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 viewport_->layer()->SetAnimation(aura::Window::CreateDefaultAnimation()); | 134 ui::LayerAnimator::ScopedSettings settings(viewport_->layer()->GetAnimator()); |
| 135 viewport_->layer()->SetTransform(transform); | 135 viewport_->layer()->SetTransform(transform); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void WorkspaceManager::RotateWindows(aura::Window* source, | 138 void WorkspaceManager::RotateWindows(aura::Window* source, |
| 139 aura::Window* target) { | 139 aura::Window* target) { |
| 140 DCHECK(source); | 140 DCHECK(source); |
| 141 DCHECK(target); | 141 DCHECK(target); |
| 142 int source_ws_index = GetWorkspaceIndexContaining(source); | 142 int source_ws_index = GetWorkspaceIndexContaining(source); |
| 143 int target_ws_index = GetWorkspaceIndexContaining(target); | 143 int target_ws_index = GetWorkspaceIndexContaining(target); |
| 144 DCHECK(source_ws_index >= 0); | 144 DCHECK(source_ws_index >= 0); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 kWorkspaceHorizontalMargin * (num_workspaces - 1); | 240 kWorkspaceHorizontalMargin * (num_workspaces - 1); |
| 241 gfx::Rect bounds(0, 0, total_width, workspace_size_.height()); | 241 gfx::Rect bounds(0, 0, total_width, workspace_size_.height()); |
| 242 | 242 |
| 243 if (viewport_->GetTargetBounds() != bounds) | 243 if (viewport_->GetTargetBounds() != bounds) |
| 244 viewport_->SetBounds(bounds); | 244 viewport_->SetBounds(bounds); |
| 245 | 245 |
| 246 // Move to active workspace. | 246 // Move to active workspace. |
| 247 if (active_workspace_) { | 247 if (active_workspace_) { |
| 248 ui::Transform transform; | 248 ui::Transform transform; |
| 249 transform.SetTranslateX(-active_workspace_->bounds().x()); | 249 transform.SetTranslateX(-active_workspace_->bounds().x()); |
| 250 viewport_->layer()->SetAnimation(aura::Window::CreateDefaultAnimation()); | 250 ui::LayerAnimator::ScopedSettings settings( |
| 251 viewport_->layer()->GetAnimator()); |
| 251 viewport_->SetTransform(transform); | 252 viewport_->SetTransform(transform); |
| 252 } | 253 } |
| 253 } | 254 } |
| 254 | 255 |
| 255 } // namespace aura_shell | 256 } // namespace aura_shell |
| OLD | NEW |