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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 enum AnimationSpeed { | 65 enum AnimationSpeed { |
66 ANIMATION_SPEED_NORMAL, // The normal animation speed. | 66 ANIMATION_SPEED_NORMAL, // The normal animation speed. |
67 ANIMATION_SPEED_FAST, // Unit test speed which test animations. | 67 ANIMATION_SPEED_FAST, // Unit test speed which test animations. |
68 ANIMATION_SPEED_DISABLED // Unit tests which do not require animations. | 68 ANIMATION_SPEED_DISABLED // Unit tests which do not require animations. |
69 }; | 69 }; |
70 | 70 |
71 // 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. |
72 explicit MultiUserWindowManagerChromeOS(const std::string& active_user_id); | 72 explicit MultiUserWindowManagerChromeOS(const std::string& active_user_id); |
73 ~MultiUserWindowManagerChromeOS() override; | 73 ~MultiUserWindowManagerChromeOS() override; |
74 | 74 |
75 // Initializes the manager after its creation. Should only be called once. | |
76 void Init(); | |
77 | |
75 // MultiUserWindowManager overrides: | 78 // MultiUserWindowManager overrides: |
76 void SetWindowOwner( | 79 void SetWindowOwner( |
77 aura::Window* window, const std::string& user_id) override; | 80 aura::Window* window, const std::string& user_id) override; |
78 const std::string& GetWindowOwner( | 81 const std::string& GetWindowOwner( |
79 aura::Window* window) const override; | 82 aura::Window* window) const override; |
80 void ShowWindowForUser( | 83 void ShowWindowForUser( |
81 aura::Window* window, const std::string& user_id) override; | 84 aura::Window* window, const std::string& user_id) override; |
82 bool AreWindowsSharedAmongUsers() const override; | 85 bool AreWindowsSharedAmongUsers() const override; |
83 void GetOwnersOfVisibleWindows( | 86 void GetOwnersOfVisibleWindows( |
84 std::set<std::string>* user_ids) const override; | 87 std::set<std::string>* user_ids) const override; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 | 235 |
233 // An observer list to be notified upon window owner changes. | 236 // An observer list to be notified upon window owner changes. |
234 ObserverList<Observer> observers_; | 237 ObserverList<Observer> observers_; |
235 | 238 |
236 // A map which remembers for owned transient windows their own visibility. | 239 // A map which remembers for owned transient windows their own visibility. |
237 TransientWindowToVisibility transient_window_to_visibility_; | 240 TransientWindowToVisibility transient_window_to_visibility_; |
238 | 241 |
239 // The currently selected active user. It is used to find the proper | 242 // The currently selected active user. It is used to find the proper |
240 // visibility state in various cases. The state is stored here instead of | 243 // visibility state in various cases. The state is stored here instead of |
241 // being read from the user manager to be in sync while a switch occurs. | 244 // being read from the user manager to be in sync while a switch occurs. |
242 std::string current_user_id_; | 245 std::string current_user_id_; |
stevenjb
2015/02/03 01:31:58
This should be able to be const, which will help e
Mr4D (OOO till 08-26)
2015/02/03 02:06:05
The current user can be changed (ActiveUserChanged
| |
243 | 246 |
244 // The blocker which controls the desktop notification visibility based on the | 247 // The blocker which controls the desktop notification visibility based on the |
245 // current multi-user status. | 248 // current multi-user status. |
246 scoped_ptr<MultiUserNotificationBlockerChromeOS> notification_blocker_; | 249 scoped_ptr<MultiUserNotificationBlockerChromeOS> notification_blocker_; |
247 | 250 |
248 // The notification registrar to track the creation of browser windows. | 251 // The notification registrar to track the creation of browser windows. |
249 content::NotificationRegistrar registrar_; | 252 content::NotificationRegistrar registrar_; |
250 | 253 |
251 // Suppress changes to the visibility flag while we are changing it ourselves. | 254 // Suppress changes to the visibility flag while we are changing it ourselves. |
252 bool suppress_visibility_changes_; | 255 bool suppress_visibility_changes_; |
253 | 256 |
254 // Caching the current multi profile mode since the detection which mode is | 257 // Caching the current multi profile mode since the detection which mode is |
255 // used is quite expensive. | 258 // used is quite expensive. |
256 static MultiProfileMode multi_user_mode_; | 259 static MultiProfileMode multi_user_mode_; |
257 | 260 |
258 // The speed which is used to perform any animations. | 261 // The speed which is used to perform any animations. |
259 AnimationSpeed animation_speed_; | 262 AnimationSpeed animation_speed_; |
260 | 263 |
261 // The animation between users. | 264 // The animation between users. |
262 scoped_ptr<UserSwichAnimatorChromeOS> animation_; | 265 scoped_ptr<UserSwichAnimatorChromeOS> animation_; |
263 | 266 |
264 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); | 267 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); |
265 }; | 268 }; |
266 | 269 |
267 } // namespace chrome | 270 } // namespace chrome |
268 | 271 |
269 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H _ | 272 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H _ |
OLD | NEW |