OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/window_animations.h" | 5 #include "ash/wm/window_animations.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); | 391 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); |
392 } | 392 } |
393 | 393 |
394 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { | 394 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { |
395 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> | 395 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> |
396 GetScreenBoundsOfItemIconForWindow(window); | 396 GetScreenBoundsOfItemIconForWindow(window); |
397 if (target_bounds.IsEmpty()) { | 397 if (target_bounds.IsEmpty()) { |
398 // Assume the launcher is overflowed, zoom off to the bottom right of the | 398 // Assume the launcher is overflowed, zoom off to the bottom right of the |
399 // work area. | 399 // work area. |
400 gfx::Rect work_area = | 400 gfx::Rect work_area = |
401 gfx::Screen::GetDisplayNearestWindow(window).work_area(); | 401 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
402 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); | 402 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); |
403 } | 403 } |
404 target_bounds = | 404 target_bounds = |
405 ScreenAsh::ConvertRectFromScreen(window->parent(), target_bounds); | 405 ScreenAsh::ConvertRectFromScreen(window->parent(), target_bounds); |
406 return target_bounds; | 406 return target_bounds; |
407 } | 407 } |
408 | 408 |
409 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { | 409 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { |
410 // Recalculate the transform at restore time since the launcher item may have | 410 // Recalculate the transform at restore time since the launcher item may have |
411 // moved while the window was minimized. | 411 // moved while the window was minimized. |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 return AnimateShowWindow(window); | 1164 return AnimateShowWindow(window); |
1165 } else { | 1165 } else { |
1166 // Don't start hiding the window again if it's already being hidden. | 1166 // Don't start hiding the window again if it's already being hidden. |
1167 return window->layer()->GetTargetOpacity() != 0.0f && | 1167 return window->layer()->GetTargetOpacity() != 0.0f && |
1168 AnimateHideWindow(window); | 1168 AnimateHideWindow(window); |
1169 } | 1169 } |
1170 } | 1170 } |
1171 | 1171 |
1172 } // namespace internal | 1172 } // namespace internal |
1173 } // namespace ash | 1173 } // namespace ash |
OLD | NEW |