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> |
11 | 11 |
12 #include "ash/screen_ash.h" | 12 #include "ash/screen_util.h" |
13 #include "ash/shelf/shelf.h" | 13 #include "ash/shelf/shelf.h" |
14 #include "ash/shelf/shelf_layout_manager.h" | 14 #include "ash/shelf/shelf_layout_manager.h" |
15 #include "ash/shelf/shelf_widget.h" | 15 #include "ash/shelf/shelf_widget.h" |
16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
17 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
18 #include "ash/wm/workspace_controller.h" | 18 #include "ash/wm/workspace_controller.h" |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
20 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" |
21 #include "base/logging.h" | 21 #include "base/logging.h" |
22 #include "base/message_loop/message_loop.h" | 22 #include "base/message_loop/message_loop.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } // namespace | 70 } // namespace |
71 | 71 |
72 const int kCrossFadeDurationMS = 200; | 72 const int kCrossFadeDurationMS = 200; |
73 | 73 |
74 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { | 74 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { |
75 // Recalculate the transform at restore time since the launcher item may have | 75 // Recalculate the transform at restore time since the launcher item may have |
76 // moved while the window was minimized. | 76 // moved while the window was minimized. |
77 gfx::Rect bounds = window->bounds(); | 77 gfx::Rect bounds = window->bounds(); |
78 gfx::Rect target_bounds = GetMinimizeAnimationTargetBoundsInScreen(window); | 78 gfx::Rect target_bounds = GetMinimizeAnimationTargetBoundsInScreen(window); |
79 target_bounds = | 79 target_bounds = |
80 ScreenAsh::ConvertRectFromScreen(window->parent(), target_bounds); | 80 ScreenUtil::ConvertRectFromScreen(window->parent(), target_bounds); |
81 | 81 |
82 float scale_x = static_cast<float>(target_bounds.width()) / bounds.width(); | 82 float scale_x = static_cast<float>(target_bounds.width()) / bounds.width(); |
83 float scale_y = static_cast<float>(target_bounds.height()) / bounds.height(); | 83 float scale_y = static_cast<float>(target_bounds.height()) / bounds.height(); |
84 | 84 |
85 scoped_ptr<ui::InterpolatedTransform> scale( | 85 scoped_ptr<ui::InterpolatedTransform> scale( |
86 new ui::InterpolatedScale(gfx::Point3F(1, 1, 1), | 86 new ui::InterpolatedScale(gfx::Point3F(1, 1, 1), |
87 gfx::Point3F(scale_x, scale_y, 1))); | 87 gfx::Point3F(scale_x, scale_y, 1))); |
88 | 88 |
89 scoped_ptr<ui::InterpolatedTransform> translation( | 89 scoped_ptr<ui::InterpolatedTransform> translation( |
90 new ui::InterpolatedTranslation( | 90 new ui::InterpolatedTranslation( |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } | 541 } |
542 | 542 |
543 // Assume the shelf is overflowed, zoom off to the bottom right of the | 543 // Assume the shelf is overflowed, zoom off to the bottom right of the |
544 // work area. | 544 // work area. |
545 gfx::Rect work_area = | 545 gfx::Rect work_area = |
546 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); | 546 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
547 return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0); | 547 return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0); |
548 } | 548 } |
549 | 549 |
550 } // namespace ash | 550 } // namespace ash |
OLD | NEW |