Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_USER_SWITCH_ANIMATOR_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_USER_SWITCH_ANIMATOR_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_USER_SWITCH_ANIMATOR_CHROMEOS_H_ | 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_USER_SWITCH_ANIMATOR_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 class Window; | 14 class Window; |
| 15 } // namespace aura | 15 } // namespace aura |
| 16 | 16 |
| 17 namespace chrome { | 17 namespace chrome { |
| 18 | 18 |
| 19 class MultiUserWindowManagerChromeOS; | 19 class MultiUserWindowManagerChromeOS; |
| 20 | 20 |
| 21 // A class which performs transitions animations between users. Upon creation, | 21 // A class which performs transitions animations between users. Upon creation, |
| 22 // the animation gets started and upon destruction the animation gets finished | 22 // the animation gets started and upon destruction the animation gets finished |
| 23 // if not done yet. | 23 // if not done yet. |
| 24 // Specifying |animation_disabled| upon creation will perform the transition | 24 // Specifying |animation_disabled| upon creation will perform the transition |
| 25 // without visible animations. | 25 // without visible animations. |
| 26 class UserSwichAnimatorChromeOS { | 26 class UserSwitchAnimatorChromeOS { |
|
Mr4D (OOO till 08-26)
2015/03/21 20:59:16
Oh wow. Thanks for fixing the typo! Amazing that n
| |
| 27 public: | 27 public: |
| 28 // The animation step for the user change animation. | 28 // The animation step for the user change animation. |
| 29 enum AnimationStep { | 29 enum AnimationStep { |
| 30 ANIMATION_STEP_HIDE_OLD_USER, // Hiding the old user (and shelf). | 30 ANIMATION_STEP_HIDE_OLD_USER, // Hiding the old user (and shelf). |
| 31 ANIMATION_STEP_SHOW_NEW_USER, // Show the shelf of the new user. | 31 ANIMATION_STEP_SHOW_NEW_USER, // Show the shelf of the new user. |
| 32 ANIMATION_STEP_FINALIZE, // All animations are done - final cleanup. | 32 ANIMATION_STEP_FINALIZE, // All animations are done - final cleanup. |
| 33 ANIMATION_STEP_ENDED // The animation has ended. | 33 ANIMATION_STEP_ENDED // The animation has ended. |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 UserSwichAnimatorChromeOS(MultiUserWindowManagerChromeOS* owner, | 36 UserSwitchAnimatorChromeOS(MultiUserWindowManagerChromeOS* owner, |
| 37 const std::string& new_user_id, | 37 const std::string& new_user_id, |
| 38 int animation_speed_ms); | 38 int animation_speed_ms); |
| 39 ~UserSwichAnimatorChromeOS(); | 39 ~UserSwitchAnimatorChromeOS(); |
| 40 | 40 |
| 41 // Check if a window is covering the entire work area of the screen it is on. | 41 // Check if a window is covering the entire work area of the screen it is on. |
| 42 static bool CoversScreen(aura::Window* window); | 42 static bool CoversScreen(aura::Window* window); |
| 43 | 43 |
| 44 bool IsAnimationFinished() { | 44 bool IsAnimationFinished() { |
| 45 return animation_step_ == ANIMATION_STEP_ENDED; | 45 return animation_step_ == ANIMATION_STEP_ENDED; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Returns the user id for which the wallpaper is currently shown. | 48 // Returns the user id for which the wallpaper is currently shown. |
| 49 // If a wallpaper is transitioning to B it will be returned as "->B". | 49 // If a wallpaper is transitioning to B it will be returned as "->B". |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 // The screen cover status before the animation has started. | 103 // The screen cover status before the animation has started. |
| 104 TransitioningScreenCover screen_cover_; | 104 TransitioningScreenCover screen_cover_; |
| 105 | 105 |
| 106 // A timer which watches to executes the second part of a "user changed" | 106 // A timer which watches to executes the second part of a "user changed" |
| 107 // animation. Note that this timer exists only during such an animation. | 107 // animation. Note that this timer exists only during such an animation. |
| 108 scoped_ptr<base::Timer> user_changed_animation_timer_; | 108 scoped_ptr<base::Timer> user_changed_animation_timer_; |
| 109 | 109 |
| 110 // For unit tests: Check which wallpaper was set. | 110 // For unit tests: Check which wallpaper was set. |
| 111 std::string wallpaper_user_id_; | 111 std::string wallpaper_user_id_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(UserSwichAnimatorChromeOS); | 113 DISALLOW_COPY_AND_ASSIGN(UserSwitchAnimatorChromeOS); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace chrome | 116 } // namespace chrome |
| 117 | 117 |
| 118 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_USER_SWITCH_ANIMATOR_CHROMEOS_H_ | 118 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_USER_SWITCH_ANIMATOR_CHROMEOS_H_ |
| OLD | NEW |