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 COMPONENTS_USER_MANAGER_USER_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_H_ |
6 #define COMPONENTS_USER_MANAGER_USER_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "components/user_manager/user_image/user_image.h" | 13 #include "components/user_manager/user_image/user_image.h" |
14 #include "components/user_manager/user_info.h" | 14 #include "components/user_manager/user_info.h" |
15 #include "components/user_manager/user_manager_export.h" | 15 #include "components/user_manager/user_manager_export.h" |
16 #include "components/user_manager/user_type.h" | 16 #include "components/user_manager/user_type.h" |
17 #include "third_party/skia/include/core/SkBitmap.h" | 17 #include "third_party/skia/include/core/SkBitmap.h" |
18 #include "ui/gfx/image/image_skia.h" | 18 #include "ui/gfx/image/image_skia.h" |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 class ChromeUserManagerImpl; | 21 class ChromeUserManagerImpl; |
22 class FakeLoginUtils; | 22 class FakeLoginUtils; |
23 class FakeUserManager; | 23 class FakeChromeUserManager; |
24 class MockUserManager; | 24 class MockUserManager; |
25 class SupervisedUserManagerImpl; | 25 class SupervisedUserManagerImpl; |
26 class UserAddingScreenTest; | 26 class UserAddingScreenTest; |
27 class UserImageManagerImpl; | 27 class UserImageManagerImpl; |
28 class UserSessionManager; | 28 class UserSessionManager; |
29 } | 29 } |
30 | 30 |
31 namespace user_manager { | 31 namespace user_manager { |
32 | 32 |
33 class UserManagerBase; | 33 class UserManagerBase; |
| 34 class FakeUserManager; |
34 | 35 |
35 // A class representing information about a previously logged in user. | 36 // A class representing information about a previously logged in user. |
36 // Each user has a canonical email (username), returned by |email()| and | 37 // Each user has a canonical email (username), returned by |email()| and |
37 // may have a different displayed email (in the raw form as entered by user), | 38 // may have a different displayed email (in the raw form as entered by user), |
38 // returned by |displayed_email()|. | 39 // returned by |displayed_email()|. |
39 // Displayed emails are for use in UI only, anywhere else users must be referred | 40 // Displayed emails are for use in UI only, anywhere else users must be referred |
40 // to by |email()|. | 41 // to by |email()|. |
41 class USER_MANAGER_EXPORT User : public UserInfo { | 42 class USER_MANAGER_EXPORT User : public UserInfo { |
42 public: | 43 public: |
43 // User OAuth token status according to the last check. | 44 // User OAuth token status according to the last check. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 bool is_profile_created() const { return profile_is_created_; } | 163 bool is_profile_created() const { return profile_is_created_; } |
163 | 164 |
164 protected: | 165 protected: |
165 friend class UserManagerBase; | 166 friend class UserManagerBase; |
166 friend class chromeos::ChromeUserManagerImpl; | 167 friend class chromeos::ChromeUserManagerImpl; |
167 friend class chromeos::SupervisedUserManagerImpl; | 168 friend class chromeos::SupervisedUserManagerImpl; |
168 friend class chromeos::UserImageManagerImpl; | 169 friend class chromeos::UserImageManagerImpl; |
169 friend class chromeos::UserSessionManager; | 170 friend class chromeos::UserSessionManager; |
170 | 171 |
171 // For testing: | 172 // For testing: |
| 173 friend class FakeUserManager; |
| 174 friend class chromeos::FakeChromeUserManager; |
172 friend class chromeos::MockUserManager; | 175 friend class chromeos::MockUserManager; |
173 friend class chromeos::FakeLoginUtils; | 176 friend class chromeos::FakeLoginUtils; |
174 friend class chromeos::FakeUserManager; | |
175 friend class chromeos::UserAddingScreenTest; | 177 friend class chromeos::UserAddingScreenTest; |
176 | 178 |
177 // Do not allow anyone else to create new User instances. | 179 // Do not allow anyone else to create new User instances. |
178 static User* CreateRegularUser(const std::string& email); | 180 static User* CreateRegularUser(const std::string& email); |
179 static User* CreateGuestUser(); | 181 static User* CreateGuestUser(); |
180 static User* CreateKioskAppUser(const std::string& kiosk_app_username); | 182 static User* CreateKioskAppUser(const std::string& kiosk_app_username); |
181 static User* CreateSupervisedUser(const std::string& username); | 183 static User* CreateSupervisedUser(const std::string& username); |
182 static User* CreatePublicAccountUser(const std::string& email); | 184 static User* CreatePublicAccountUser(const std::string& email); |
183 | 185 |
184 explicit User(const std::string& email); | 186 explicit User(const std::string& email); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 282 |
281 DISALLOW_COPY_AND_ASSIGN(User); | 283 DISALLOW_COPY_AND_ASSIGN(User); |
282 }; | 284 }; |
283 | 285 |
284 // List of known users. | 286 // List of known users. |
285 typedef std::vector<User*> UserList; | 287 typedef std::vector<User*> UserList; |
286 | 288 |
287 } // namespace user_manager | 289 } // namespace user_manager |
288 | 290 |
289 #endif // COMPONENTS_USER_MANAGER_USER_H_ | 291 #endif // COMPONENTS_USER_MANAGER_USER_H_ |
OLD | NEW |