OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H_ |
6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // visibility changes from the owning user. This way the visibility can be | 54 // visibility changes from the owning user. This way the visibility can be |
55 // changed back to its requested state upon showing by us - or when the window | 55 // changed back to its requested state upon showing by us - or when the window |
56 // gets detached from its current owning parent. | 56 // gets detached from its current owning parent. |
57 class MultiUserWindowManagerChromeOS | 57 class MultiUserWindowManagerChromeOS |
58 : public MultiUserWindowManager, | 58 : public MultiUserWindowManager, |
59 public ash::SessionStateObserver, | 59 public ash::SessionStateObserver, |
60 public aura::WindowObserver, | 60 public aura::WindowObserver, |
61 public content::NotificationObserver, | 61 public content::NotificationObserver, |
62 public wm::TransientWindowObserver { | 62 public wm::TransientWindowObserver { |
63 public: | 63 public: |
| 64 // The speed which should be used to perform animations. |
| 65 enum AnimationSpeed { |
| 66 ANIMATION_SPEED_NORMAL, // The normal animation speed. |
| 67 ANIMATION_SPEED_FAST, // Unit test speed which test animations. |
| 68 ANIMATION_SPEED_DISABLED // Unit tests which do not require animations. |
| 69 }; |
| 70 |
64 // Create the manager and use |active_user_id| as the active user. | 71 // Create the manager and use |active_user_id| as the active user. |
65 explicit MultiUserWindowManagerChromeOS(const std::string& active_user_id); | 72 explicit MultiUserWindowManagerChromeOS(const std::string& active_user_id); |
66 virtual ~MultiUserWindowManagerChromeOS(); | 73 virtual ~MultiUserWindowManagerChromeOS(); |
67 | 74 |
68 // MultiUserWindowManager overrides: | 75 // MultiUserWindowManager overrides: |
69 virtual void SetWindowOwner( | 76 virtual void SetWindowOwner( |
70 aura::Window* window, const std::string& user_id) OVERRIDE; | 77 aura::Window* window, const std::string& user_id) OVERRIDE; |
71 virtual const std::string& GetWindowOwner(aura::Window* window) OVERRIDE; | 78 virtual const std::string& GetWindowOwner(aura::Window* window) OVERRIDE; |
72 virtual void ShowWindowForUser( | 79 virtual void ShowWindowForUser( |
73 aura::Window* window, const std::string& user_id) OVERRIDE; | 80 aura::Window* window, const std::string& user_id) OVERRIDE; |
(...skipping 23 matching lines...) Expand all Loading... |
97 aura::Window* transient) OVERRIDE; | 104 aura::Window* transient) OVERRIDE; |
98 virtual void OnTransientChildRemoved(aura::Window* window, | 105 virtual void OnTransientChildRemoved(aura::Window* window, |
99 aura::Window* transient) OVERRIDE; | 106 aura::Window* transient) OVERRIDE; |
100 | 107 |
101 // content::NotificationObserver overrides: | 108 // content::NotificationObserver overrides: |
102 virtual void Observe(int type, | 109 virtual void Observe(int type, |
103 const content::NotificationSource& source, | 110 const content::NotificationSource& source, |
104 const content::NotificationDetails& details) OVERRIDE; | 111 const content::NotificationDetails& details) OVERRIDE; |
105 | 112 |
106 // Disable any animations for unit tests. | 113 // Disable any animations for unit tests. |
107 void SetAnimationsForTest(bool disable); | 114 void SetAnimationSpeedForTest(AnimationSpeed speed); |
108 | 115 |
109 // Returns true when a user switch animation is running. For unit tests. | 116 // Returns true when a user switch animation is running. For unit tests. |
110 bool IsAnimationRunningForTest(); | 117 bool IsAnimationRunningForTest(); |
111 | 118 |
112 // Returns the current user for unit tests. | 119 // Returns the current user for unit tests. |
113 const std::string& GetCurrentUserForTest(); | 120 const std::string& GetCurrentUserForTest(); |
114 | 121 |
115 protected: | 122 protected: |
116 friend class UserSwichAnimatorChromeOS; | 123 friend class UserSwichAnimatorChromeOS; |
117 | 124 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // The notification registrar to track the creation of browser windows. | 244 // The notification registrar to track the creation of browser windows. |
238 content::NotificationRegistrar registrar_; | 245 content::NotificationRegistrar registrar_; |
239 | 246 |
240 // Suppress changes to the visibility flag while we are changing it ourselves. | 247 // Suppress changes to the visibility flag while we are changing it ourselves. |
241 bool suppress_visibility_changes_; | 248 bool suppress_visibility_changes_; |
242 | 249 |
243 // Caching the current multi profile mode since the detection which mode is | 250 // Caching the current multi profile mode since the detection which mode is |
244 // used is quite expensive. | 251 // used is quite expensive. |
245 static MultiProfileMode multi_user_mode_; | 252 static MultiProfileMode multi_user_mode_; |
246 | 253 |
247 // If true, all animations will be suppressed. | 254 // The speed which is used to perform any animations. |
248 bool animations_disabled_; | 255 AnimationSpeed animation_speed_; |
249 | 256 |
250 // The animation between users. | 257 // The animation between users. |
251 scoped_ptr<UserSwichAnimatorChromeOS> animation_; | 258 scoped_ptr<UserSwichAnimatorChromeOS> animation_; |
252 | 259 |
253 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); | 260 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); |
254 }; | 261 }; |
255 | 262 |
256 } // namespace chrome | 263 } // namespace chrome |
257 | 264 |
258 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H
_ | 265 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H
_ |
OLD | NEW |