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/ash_switches.h" | 12 #include "ash/ash_switches.h" |
13 #include "ash/launcher/launcher.h" | 13 #include "ash/launcher/launcher.h" |
| 14 #include "ash/screen_ash.h" |
14 #include "ash/shell.h" | 15 #include "ash/shell.h" |
15 #include "base/command_line.h" | 16 #include "base/command_line.h" |
16 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
17 #include "base/logging.h" | 18 #include "base/logging.h" |
18 #include "base/message_loop.h" | 19 #include "base/message_loop.h" |
19 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
20 #include "base/time.h" | 21 #include "base/time.h" |
21 #include "ui/aura/client/aura_constants.h" | 22 #include "ui/aura/client/aura_constants.h" |
22 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
23 #include "ui/aura/window_observer.h" | 24 #include "ui/aura/window_observer.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { | 391 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { |
391 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> | 392 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> |
392 GetScreenBoundsOfItemIconForWindow(window); | 393 GetScreenBoundsOfItemIconForWindow(window); |
393 if (target_bounds.IsEmpty()) { | 394 if (target_bounds.IsEmpty()) { |
394 // Assume the launcher is overflowed, zoom off to the bottom right of the | 395 // Assume the launcher is overflowed, zoom off to the bottom right of the |
395 // work area. | 396 // work area. |
396 gfx::Rect work_area = | 397 gfx::Rect work_area = |
397 gfx::Screen::GetDisplayNearestWindow(window).work_area(); | 398 gfx::Screen::GetDisplayNearestWindow(window).work_area(); |
398 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); | 399 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); |
399 } | 400 } |
| 401 target_bounds = |
| 402 ScreenAsh::ConvertRectFromScreen(window->parent(), target_bounds); |
400 return target_bounds; | 403 return target_bounds; |
401 } | 404 } |
402 | 405 |
403 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { | 406 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { |
404 // Recalculate the transform at restore time since the launcher item may have | 407 // Recalculate the transform at restore time since the launcher item may have |
405 // moved while the window was minimized. | 408 // moved while the window was minimized. |
406 gfx::Rect bounds = window->bounds(); | 409 gfx::Rect bounds = window->bounds(); |
407 gfx::Rect target_bounds = GetMinimizeRectForWindow(window); | 410 gfx::Rect target_bounds = GetMinimizeRectForWindow(window); |
408 | 411 |
409 float scale_x = static_cast<float>(target_bounds.height()) / bounds.width(); | 412 float scale_x = static_cast<float>(target_bounds.height()) / bounds.width(); |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 AnimateHideWindow(window); | 854 AnimateHideWindow(window); |
852 } | 855 } |
853 } | 856 } |
854 | 857 |
855 void SetDelayedOldLayerDeletionInCrossFadeForTest(bool value) { | 858 void SetDelayedOldLayerDeletionInCrossFadeForTest(bool value) { |
856 delayed_old_layer_deletion_in_cross_fade_for_test_ = value; | 859 delayed_old_layer_deletion_in_cross_fade_for_test_ = value; |
857 } | 860 } |
858 | 861 |
859 } // namespace internal | 862 } // namespace internal |
860 } // namespace ash | 863 } // namespace ash |
OLD | NEW |