| 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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 direction == WORKSPACE_ANIMATE_UP ? | 934 direction == WORKSPACE_ANIMATE_UP ? |
| 935 WORKSPACE_SCALE_ABOVE : WORKSPACE_SCALE_BELOW); | 935 WORKSPACE_SCALE_ABOVE : WORKSPACE_SCALE_BELOW); |
| 936 // NOTE: Hide() must be before SetOpacity(), else | 936 // NOTE: Hide() must be before SetOpacity(), else |
| 937 // VisibilityController::UpdateLayerVisibility doesn't pass the false to the | 937 // VisibilityController::UpdateLayerVisibility doesn't pass the false to the |
| 938 // layer so that the layer and window end up out of sync and confused. | 938 // layer so that the layer and window end up out of sync and confused. |
| 939 window->Hide(); | 939 window->Hide(); |
| 940 window->layer()->SetOpacity(0.0f); | 940 window->layer()->SetOpacity(0.0f); |
| 941 } | 941 } |
| 942 } | 942 } |
| 943 | 943 |
| 944 base::TimeDelta GetSystemBackgroundDestroyDuration() { |
| 945 return base::TimeDelta::FromMilliseconds( |
| 946 std::max(kWorkspaceCrossFadeDurationMs, kWorkspaceSwitchTimeMS)); |
| 947 } |
| 948 |
| 944 namespace internal { | 949 namespace internal { |
| 945 | 950 |
| 946 TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds, | 951 TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds, |
| 947 const gfx::Rect& new_bounds) { | 952 const gfx::Rect& new_bounds) { |
| 948 if (WorkspaceController::IsWorkspace2Enabled()) | 953 if (WorkspaceController::IsWorkspace2Enabled()) |
| 949 return base::TimeDelta::FromMilliseconds(kWorkspaceCrossFadeDurationMs); | 954 return base::TimeDelta::FromMilliseconds(kWorkspaceCrossFadeDurationMs); |
| 950 | 955 |
| 951 int old_area = old_bounds.width() * old_bounds.height(); | 956 int old_area = old_bounds.width() * old_bounds.height(); |
| 952 int new_area = new_bounds.width() * new_bounds.height(); | 957 int new_area = new_bounds.width() * new_bounds.height(); |
| 953 int max_area = std::max(old_area, new_area); | 958 int max_area = std::max(old_area, new_area); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 981 AnimateHideWindow(window); | 986 AnimateHideWindow(window); |
| 982 } | 987 } |
| 983 } | 988 } |
| 984 | 989 |
| 985 void SetDelayedOldLayerDeletionInCrossFadeForTest(bool value) { | 990 void SetDelayedOldLayerDeletionInCrossFadeForTest(bool value) { |
| 986 delayed_old_layer_deletion_in_cross_fade_for_test_ = value; | 991 delayed_old_layer_deletion_in_cross_fade_for_test_ = value; |
| 987 } | 992 } |
| 988 | 993 |
| 989 } // namespace internal | 994 } // namespace internal |
| 990 } // namespace ash | 995 } // namespace ash |
| OLD | NEW |