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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 kLayerScaleBelowSize; | 506 kLayerScaleBelowSize; |
507 gfx::Transform transform; | 507 gfx::Transform transform; |
508 transform.Translate(-layer->bounds().width() * (scale - 1.0f) / 2, | 508 transform.Translate(-layer->bounds().width() * (scale - 1.0f) / 2, |
509 -layer->bounds().height() * (scale - 1.0f) / 2); | 509 -layer->bounds().height() * (scale - 1.0f) / 2); |
510 transform.Scale(scale, scale); | 510 transform.Scale(scale, scale); |
511 layer->SetTransform(transform); | 511 layer->SetTransform(transform); |
512 } | 512 } |
513 | 513 |
514 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { | 514 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { |
515 Launcher* launcher = Launcher::ForWindow(window); | 515 Launcher* launcher = Launcher::ForWindow(window); |
516 // Launcher is created lazily and can be NULL. | 516 // Shelf is created lazily and can be NULL. |
517 if (!launcher) | 517 if (!launcher) |
518 return gfx::Rect(); | 518 return gfx::Rect(); |
519 gfx::Rect item_rect = launcher-> | 519 gfx::Rect item_rect = launcher->GetScreenBoundsOfItemIconForWindow(window); |
520 GetScreenBoundsOfItemIconForWindow(window); | |
521 | 520 |
522 // The launcher item is visible and has an icon. | 521 // The launcher item is visible and has an icon. |
523 if (!item_rect.IsEmpty()) | 522 if (!item_rect.IsEmpty()) |
524 return item_rect; | 523 return item_rect; |
525 | 524 |
526 // If both the icon width and height are 0, then there is no icon in the | 525 // If both the icon width and height are 0, then there is no icon in the |
527 // launcher for |window| or the icon is hidden in the overflow menu. If the | 526 // launcher for |window| or the icon is hidden in the overflow menu. If the |
528 // launcher is auto hidden, one of the height or width will be 0 but the | 527 // launcher is auto hidden, one of the height or width will be 0 but the |
529 // position in the launcher and the major dimension are still reported | 528 // position in the launcher and the major dimension are still reported |
530 // correctly and the window can be animated to the launcher item's light | 529 // correctly and the window can be animated to the launcher item's light |
(...skipping 23 matching lines...) Expand all Loading... |
554 } | 553 } |
555 | 554 |
556 // Assume the launcher is overflowed, zoom off to the bottom right of the | 555 // Assume the launcher is overflowed, zoom off to the bottom right of the |
557 // work area. | 556 // work area. |
558 gfx::Rect work_area = | 557 gfx::Rect work_area = |
559 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); | 558 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
560 return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0); | 559 return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0); |
561 } | 560 } |
562 | 561 |
563 } // namespace ash | 562 } // namespace ash |
OLD | NEW |