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/session_state_animator.h" | 5 #include "ash/wm/session_state_animator.h" |
6 | 6 |
| 7 #include "ash/common/ash_switches.h" |
7 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
8 #include "ash/shell.h" | 9 #include "ash/shell.h" |
9 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
| 11 #include "base/command_line.h" |
10 #include "ui/aura/client/aura_constants.h" | 12 #include "ui/aura/client/aura_constants.h" |
11 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
12 #include "ui/compositor/layer_animation_observer.h" | 14 #include "ui/compositor/layer_animation_observer.h" |
13 #include "ui/compositor/layer_animation_sequence.h" | 15 #include "ui/compositor/layer_animation_sequence.h" |
14 #include "ui/compositor/scoped_layer_animation_settings.h" | 16 #include "ui/compositor/scoped_layer_animation_settings.h" |
15 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
16 | 18 |
17 namespace ash { | 19 namespace ash { |
18 | 20 |
| 21 namespace { |
| 22 |
| 23 bool IsTouchViewEnabled() { |
| 24 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 25 switches::kAshEnableTouchView) || |
| 26 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 27 switches::kAshEnableTouchViewTesting); |
| 28 } |
| 29 |
| 30 } // namespace |
| 31 |
19 const int SessionStateAnimator::kAllLockScreenContainersMask = | 32 const int SessionStateAnimator::kAllLockScreenContainersMask = |
20 SessionStateAnimator::LOCK_SCREEN_WALLPAPER | | 33 SessionStateAnimator::LOCK_SCREEN_WALLPAPER | |
21 SessionStateAnimator::LOCK_SCREEN_CONTAINERS | | 34 SessionStateAnimator::LOCK_SCREEN_CONTAINERS | |
22 SessionStateAnimator::LOCK_SCREEN_RELATED_CONTAINERS; | 35 SessionStateAnimator::LOCK_SCREEN_RELATED_CONTAINERS; |
23 | 36 |
24 const int SessionStateAnimator::kAllNonRootContainersMask = | 37 const int SessionStateAnimator::kAllNonRootContainersMask = |
25 SessionStateAnimator::kAllLockScreenContainersMask | | 38 SessionStateAnimator::kAllLockScreenContainersMask | |
26 SessionStateAnimator::WALLPAPER | SessionStateAnimator::LAUNCHER | | 39 SessionStateAnimator::WALLPAPER | SessionStateAnimator::LAUNCHER | |
27 SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS; | 40 SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS; |
28 | 41 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return base::TimeDelta::FromMilliseconds(150); | 88 return base::TimeDelta::FromMilliseconds(150); |
76 case ANIMATION_SPEED_FAST: | 89 case ANIMATION_SPEED_FAST: |
77 return base::TimeDelta::FromMilliseconds(150); | 90 return base::TimeDelta::FromMilliseconds(150); |
78 case ANIMATION_SPEED_SHOW_LOCK_SCREEN: | 91 case ANIMATION_SPEED_SHOW_LOCK_SCREEN: |
79 return base::TimeDelta::FromMilliseconds(200); | 92 return base::TimeDelta::FromMilliseconds(200); |
80 case ANIMATION_SPEED_MOVE_WINDOWS: | 93 case ANIMATION_SPEED_MOVE_WINDOWS: |
81 return base::TimeDelta::FromMilliseconds(350); | 94 return base::TimeDelta::FromMilliseconds(350); |
82 case ANIMATION_SPEED_UNDO_MOVE_WINDOWS: | 95 case ANIMATION_SPEED_UNDO_MOVE_WINDOWS: |
83 return base::TimeDelta::FromMilliseconds(350); | 96 return base::TimeDelta::FromMilliseconds(350); |
84 case ANIMATION_SPEED_SHUTDOWN: | 97 case ANIMATION_SPEED_SHUTDOWN: |
85 return base::TimeDelta::FromMilliseconds(1000); | 98 return IsTouchViewEnabled() ? base::TimeDelta::FromMilliseconds(2500) |
| 99 : base::TimeDelta::FromMilliseconds(1000); |
86 case ANIMATION_SPEED_REVERT_SHUTDOWN: | 100 case ANIMATION_SPEED_REVERT_SHUTDOWN: |
87 return base::TimeDelta::FromMilliseconds(500); | 101 return base::TimeDelta::FromMilliseconds(500); |
88 } | 102 } |
89 // Satisfy compilers that do not understand that we will return from switch | 103 // Satisfy compilers that do not understand that we will return from switch |
90 // above anyway. | 104 // above anyway. |
91 DCHECK(false) << "Unhandled animation speed " << speed; | 105 DCHECK(false) << "Unhandled animation speed " << speed; |
92 return base::TimeDelta(); | 106 return base::TimeDelta(); |
93 } | 107 } |
94 | 108 |
95 } // namespace ash | 109 } // namespace ash |
OLD | NEW |