| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/wm/overview/scoped_transform_overview_window.h" | 5 #include "ash/wm/overview/scoped_transform_overview_window.h" |
| 6 | 6 |
| 7 #include "ash/screen_ash.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/wm/overview/scoped_window_copy.h" | 9 #include "ash/wm/overview/scoped_window_copy.h" |
| 10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
| 11 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
| 12 #include "ui/aura/client/screen_position_client.h" | 12 #include "ui/aura/client/screen_position_client.h" |
| 13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 14 #include "ui/compositor/scoped_layer_animation_settings.h" | 14 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 15 #include "ui/gfx/animation/tween.h" | 15 #include "ui/gfx/animation/tween.h" |
| 16 #include "ui/views/corewm/window_animations.h" | 16 #include "ui/views/corewm/window_animations.h" |
| 17 #include "ui/views/corewm/window_util.h" | 17 #include "ui/views/corewm/window_util.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 return true; | 132 return true; |
| 133 window = GetModalTransientParent(window); | 133 window = GetModalTransientParent(window); |
| 134 } | 134 } |
| 135 return false; | 135 return false; |
| 136 } | 136 } |
| 137 | 137 |
| 138 gfx::Rect ScopedTransformOverviewWindow::GetBoundsInScreen() const { | 138 gfx::Rect ScopedTransformOverviewWindow::GetBoundsInScreen() const { |
| 139 gfx::Rect bounds; | 139 gfx::Rect bounds; |
| 140 aura::Window* window = window_; | 140 aura::Window* window = window_; |
| 141 while (window) { | 141 while (window) { |
| 142 bounds.Union(ScreenAsh::ConvertRectToScreen(window->parent(), | 142 bounds.Union(ScreenUtil::ConvertRectToScreen(window->parent(), |
| 143 window->GetTargetBounds())); | 143 window->GetTargetBounds())); |
| 144 window = GetModalTransientParent(window); | 144 window = GetModalTransientParent(window); |
| 145 } | 145 } |
| 146 return bounds; | 146 return bounds; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ScopedTransformOverviewWindow::RestoreWindow() { | 149 void ScopedTransformOverviewWindow::RestoreWindow() { |
| 150 if (minimized_ && window_->GetProperty(aura::client::kShowStateKey) == | 150 if (minimized_ && window_->GetProperty(aura::client::kShowStateKey) == |
| 151 ui::SHOW_STATE_MINIMIZED) { | 151 ui::SHOW_STATE_MINIMIZED) { |
| 152 window_->Show(); | 152 window_->Show(); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 const gfx::Transform& transform, | 238 const gfx::Transform& transform, |
| 239 bool animate) { | 239 bool animate) { |
| 240 gfx::Point origin(GetBoundsInScreen().origin()); | 240 gfx::Point origin(GetBoundsInScreen().origin()); |
| 241 aura::Window* window = window_; | 241 aura::Window* window = window_; |
| 242 while (views::corewm::GetTransientParent(window)) | 242 while (views::corewm::GetTransientParent(window)) |
| 243 window = views::corewm::GetTransientParent(window); | 243 window = views::corewm::GetTransientParent(window); |
| 244 for (ScopedVector<ScopedWindowCopy>::const_iterator iter = | 244 for (ScopedVector<ScopedWindowCopy>::const_iterator iter = |
| 245 window_copies_.begin(); iter != window_copies_.end(); ++iter) { | 245 window_copies_.begin(); iter != window_copies_.end(); ++iter) { |
| 246 SetTransformOnWindow( | 246 SetTransformOnWindow( |
| 247 (*iter)->GetWindow(), | 247 (*iter)->GetWindow(), |
| 248 TranslateTransformOrigin(ScreenAsh::ConvertRectToScreen( | 248 TranslateTransformOrigin(ScreenUtil::ConvertRectToScreen( |
| 249 (*iter)->GetWindow()->parent(), | 249 (*iter)->GetWindow()->parent(), |
| 250 (*iter)->GetWindow()->GetTargetBounds()).origin() - origin, | 250 (*iter)->GetWindow()->GetTargetBounds()).origin() - origin, |
| 251 transform), | 251 transform), |
| 252 animate); | 252 animate); |
| 253 } | 253 } |
| 254 SetTransformOnWindowAndAllTransientChildren( | 254 SetTransformOnWindowAndAllTransientChildren( |
| 255 window, | 255 window, |
| 256 TranslateTransformOrigin(ScreenAsh::ConvertRectToScreen( | 256 TranslateTransformOrigin(ScreenUtil::ConvertRectToScreen( |
| 257 window->parent(), window->GetTargetBounds()).origin() - origin, | 257 window->parent(), window->GetTargetBounds()).origin() - origin, |
| 258 transform), | 258 transform), |
| 259 animate); | 259 animate); |
| 260 } | 260 } |
| 261 | 261 |
| 262 void ScopedTransformOverviewWindow::PrepareForOverview() { | 262 void ScopedTransformOverviewWindow::PrepareForOverview() { |
| 263 DCHECK(!overview_started_); | 263 DCHECK(!overview_started_); |
| 264 overview_started_ = true; | 264 overview_started_ = true; |
| 265 ash::wm::GetWindowState(window_)->set_ignored_by_shelf(true); | 265 ash::wm::GetWindowState(window_)->set_ignored_by_shelf(true); |
| 266 RestoreWindow(); | 266 RestoreWindow(); |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace ash | 269 } // namespace ash |
| OLD | NEW |