Index: ash/wm/window_animations.cc |
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc |
index bd56fa0f344ec85fc811678242415995779f6a38..133f0958e9260675ff5f2f8725bd613eb89e9706 100644 |
--- a/ash/wm/window_animations.cc |
+++ b/ash/wm/window_animations.cc |
@@ -319,7 +319,11 @@ void AnimateHideWindow_Fade(aura::Window* window) { |
} |
gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { |
- gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> |
+ Launcher* launcher = Launcher::ForWindow(window); |
+ // Launcher is created lazily and can be NULL. |
+ if (!launcher) |
+ return gfx::Rect(); |
+ gfx::Rect target_bounds = Launcher::ForWindow(window)-> |
GetScreenBoundsOfItemIconForWindow(window); |
if (target_bounds.IsEmpty()) { |
// Assume the launcher is overflowed, zoom off to the bottom right of the |