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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 window->layer()->SetTransform(transform); | 390 window->layer()->SetTransform(transform); |
391 settings.SetTransitionDuration(settings.GetTransitionDuration() / 2); | 391 settings.SetTransitionDuration(settings.GetTransitionDuration() / 2); |
392 window->layer()->SetOpacity(1.0f); | 392 window->layer()->SetOpacity(1.0f); |
393 window->layer()->SetOpacity(0.0f); | 393 window->layer()->SetOpacity(0.0f); |
394 } | 394 } |
395 animator->set_preemption_strategy( | 395 animator->set_preemption_strategy( |
396 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); | 396 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); |
397 } | 397 } |
398 | 398 |
399 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { | 399 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { |
400 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> | 400 gfx::Rect target_bounds = Launcher::ForWindow(window)-> |
sky
2012/10/17 16:25:20
This should NULL check launcher.
oshima
2012/10/17 17:49:43
There wasn't null check. Why we need now?
sky
2012/10/17 21:22:56
It's a bug. The launcher is lazily created.
| |
401 GetScreenBoundsOfItemIconForWindow(window); | 401 GetScreenBoundsOfItemIconForWindow(window); |
402 if (target_bounds.IsEmpty()) { | 402 if (target_bounds.IsEmpty()) { |
403 // Assume the launcher is overflowed, zoom off to the bottom right of the | 403 // Assume the launcher is overflowed, zoom off to the bottom right of the |
404 // work area. | 404 // work area. |
405 gfx::Rect work_area = | 405 gfx::Rect work_area = |
406 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); | 406 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
407 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); | 407 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); |
408 } | 408 } |
409 target_bounds = | 409 target_bounds = |
410 ScreenAsh::ConvertRectFromScreen(window->parent(), target_bounds); | 410 ScreenAsh::ConvertRectFromScreen(window->parent(), target_bounds); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
876 return AnimateShowWindow(window); | 876 return AnimateShowWindow(window); |
877 } else { | 877 } else { |
878 // Don't start hiding the window again if it's already being hidden. | 878 // Don't start hiding the window again if it's already being hidden. |
879 return window->layer()->GetTargetOpacity() != 0.0f && | 879 return window->layer()->GetTargetOpacity() != 0.0f && |
880 AnimateHideWindow(window); | 880 AnimateHideWindow(window); |
881 } | 881 } |
882 } | 882 } |
883 | 883 |
884 } // namespace internal | 884 } // namespace internal |
885 } // namespace ash | 885 } // namespace ash |
OLD | NEW |