| 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 animator->set_preemption_strategy( | 339 animator->set_preemption_strategy( |
| 340 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); | 340 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); |
| 341 } | 341 } |
| 342 | 342 |
| 343 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { | 343 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { |
| 344 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> | 344 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> |
| 345 GetScreenBoundsOfItemIconForWindow(window); | 345 GetScreenBoundsOfItemIconForWindow(window); |
| 346 if (target_bounds.IsEmpty()) { | 346 if (target_bounds.IsEmpty()) { |
| 347 // Assume the launcher is overflowed, zoom off to the bottom right of the | 347 // Assume the launcher is overflowed, zoom off to the bottom right of the |
| 348 // work area. | 348 // work area. |
| 349 gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestWindow(window); | 349 gfx::Rect work_area = |
| 350 gfx::Screen::GetMonitorNearestWindow(window).work_area(); |
| 350 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); | 351 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); |
| 351 } | 352 } |
| 352 return target_bounds; | 353 return target_bounds; |
| 353 } | 354 } |
| 354 | 355 |
| 355 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { | 356 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { |
| 356 // Recalculate the transform at restore time since the launcher item may have | 357 // Recalculate the transform at restore time since the launcher item may have |
| 357 // moved while the window was minimized. | 358 // moved while the window was minimized. |
| 358 gfx::Rect bounds = window->bounds(); | 359 gfx::Rect bounds = window->bounds(); |
| 359 gfx::Rect target_bounds = GetMinimizeRectForWindow(window); | 360 gfx::Rect target_bounds = GetMinimizeRectForWindow(window); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 } | 496 } |
| 496 | 497 |
| 497 } // namespace internal | 498 } // namespace internal |
| 498 | 499 |
| 499 ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( | 500 ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( |
| 500 aura::Window* window) { | 501 aura::Window* window) { |
| 501 return new internal::HidingWindowAnimationObserver(window); | 502 return new internal::HidingWindowAnimationObserver(window); |
| 502 } | 503 } |
| 503 | 504 |
| 504 } // namespace ash | 505 } // namespace ash |
| OLD | NEW |