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_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_H_ |
6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 class Browser; | 12 class Browser; |
13 class Profile; | 13 |
| 14 namespace content { |
| 15 class BrowserContext; |
| 16 } |
14 | 17 |
15 namespace aura { | 18 namespace aura { |
16 class Window; | 19 class Window; |
17 } | 20 } |
18 | 21 |
19 namespace chrome { | 22 namespace chrome { |
20 | 23 |
21 class MultiUserWindowManagerChromeOS; | 24 class MultiUserWindowManagerChromeOS; |
22 | 25 |
23 // The MultiUserWindowManager manages windows from multiple users by presenting | 26 // The MultiUserWindowManager manages windows from multiple users by presenting |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 71 |
69 // Gets the instance of the object. If the multi profile mode is not enabled | 72 // Gets the instance of the object. If the multi profile mode is not enabled |
70 // this will return NULL. | 73 // this will return NULL. |
71 static MultiUserWindowManager* GetInstance(); | 74 static MultiUserWindowManager* GetInstance(); |
72 | 75 |
73 // Return the current multi profile mode operation. If CreateInstance was not | 76 // Return the current multi profile mode operation. If CreateInstance was not |
74 // yet called (or was already destroyed), MULTI_PROFILE_MODE_UNINITIALIZED | 77 // yet called (or was already destroyed), MULTI_PROFILE_MODE_UNINITIALIZED |
75 // will get returned. | 78 // will get returned. |
76 static MultiProfileMode GetMultiProfileMode(); | 79 static MultiProfileMode GetMultiProfileMode(); |
77 | 80 |
| 81 // Whether or not the window's title should show the avatar. On chromeos, |
| 82 // this is true when the owner of the window is different from the owner of |
| 83 // the desktop. |
| 84 static bool ShouldShowAvatar(aura::Window* window); |
| 85 |
78 // Removes the instance. | 86 // Removes the instance. |
79 static void DeleteInstance(); | 87 static void DeleteInstance(); |
80 | 88 |
81 // A function to set an |instance| of a created MultiUserWinwdowManager object | 89 // A function to set an |instance| of a created MultiUserWinwdowManager object |
82 // with a given |mode| for test purposes. | 90 // with a given |mode| for test purposes. |
83 static void SetInstanceForTest(MultiUserWindowManager* instance, | 91 static void SetInstanceForTest(MultiUserWindowManager* instance, |
84 MultiProfileMode mode); | 92 MultiProfileMode mode); |
85 | 93 |
86 // Assigns an owner to a passed window. Note that this window's parent should | 94 // Assigns an owner to a passed window. Note that this window's parent should |
87 // be a direct child of the root window. | 95 // be a direct child of the root window. |
(...skipping 29 matching lines...) Expand all Loading... |
117 | 125 |
118 // Get the user on which the window is currently shown. If an empty string is | 126 // Get the user on which the window is currently shown. If an empty string is |
119 // passed back the window will be presented for every user. | 127 // passed back the window will be presented for every user. |
120 virtual const std::string& GetUserPresentingWindow(aura::Window* window) = 0; | 128 virtual const std::string& GetUserPresentingWindow(aura::Window* window) = 0; |
121 | 129 |
122 // Adds user to monitor starting and running V1/V2 application windows. | 130 // Adds user to monitor starting and running V1/V2 application windows. |
123 // Returns immediately if the user (identified by a |profile|) is already | 131 // Returns immediately if the user (identified by a |profile|) is already |
124 // known to the manager. Note: This function is not implemented as a | 132 // known to the manager. Note: This function is not implemented as a |
125 // SessionStateObserver to coordinate the timing of the addition with other | 133 // SessionStateObserver to coordinate the timing of the addition with other |
126 // modules. | 134 // modules. |
127 virtual void AddUser(Profile* profile) = 0; | 135 virtual void AddUser(content::BrowserContext* profile) = 0; |
128 | 136 |
129 // Manages observers. | 137 // Manages observers. |
130 virtual void AddObserver(Observer* observer) = 0; | 138 virtual void AddObserver(Observer* observer) = 0; |
131 virtual void RemoveObserver(Observer* observer) = 0; | 139 virtual void RemoveObserver(Observer* observer) = 0; |
132 | 140 |
133 protected: | 141 protected: |
134 virtual ~MultiUserWindowManager() {} | 142 virtual ~MultiUserWindowManager() {} |
135 | 143 |
136 private: | 144 private: |
137 // Caching the current multi profile mode since the detection is expensive. | 145 // Caching the current multi profile mode since the detection is expensive. |
138 static MultiProfileMode multi_user_mode_; | 146 static MultiProfileMode multi_user_mode_; |
139 }; | 147 }; |
140 | 148 |
141 } // namespace chrome | 149 } // namespace chrome |
142 | 150 |
143 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_H_ | 151 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_H_ |
OLD | NEW |