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_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "chrome/browser/chromeos/login/supervised_user_manager.h" | 12 #include "chrome/browser/chromeos/login/supervised_user_manager.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 | 15 |
16 class CrosSettings; | 16 class CrosSettings; |
17 class UserManagerImpl; | 17 class UserManagerImpl; |
18 | 18 |
19 // Implementation of the UserManager. | 19 // Implementation of the UserManager. |
20 class SupervisedUserManagerImpl | 20 class SupervisedUserManagerImpl |
21 : public SupervisedUserManager { | 21 : public SupervisedUserManager { |
22 public: | 22 public: |
23 virtual ~SupervisedUserManagerImpl(); | 23 virtual ~SupervisedUserManagerImpl(); |
24 | 24 |
25 virtual const User* CreateUserRecord( | 25 virtual const User* CreateUserRecord( |
26 const std::string& manager_id, | 26 const std::string& manager_id, |
27 const std::string& local_user_id, | 27 const std::string& local_user_id, |
28 const std::string& sync_user_id, | 28 const std::string& sync_user_id, |
29 const string16& display_name) OVERRIDE; | 29 const base::string16& display_name) OVERRIDE; |
30 virtual std::string GenerateUserId() OVERRIDE; | 30 virtual std::string GenerateUserId() OVERRIDE; |
31 virtual const User* FindByDisplayName(const string16& display_name) const | 31 virtual const User* FindByDisplayName(const base::string16& display_name) cons
t |
32 OVERRIDE; | 32 OVERRIDE; |
33 virtual const User* FindBySyncId(const std::string& sync_id) const OVERRIDE; | 33 virtual const User* FindBySyncId(const std::string& sync_id) const OVERRIDE; |
34 virtual std::string GetUserSyncId(const std::string& user_id) const OVERRIDE; | 34 virtual std::string GetUserSyncId(const std::string& user_id) const OVERRIDE; |
35 virtual string16 GetManagerDisplayName(const std::string& user_id) const | 35 virtual base::string16 GetManagerDisplayName(const std::string& user_id) const |
36 OVERRIDE; | 36 OVERRIDE; |
37 virtual std::string GetManagerUserId(const std::string& user_id) const | 37 virtual std::string GetManagerUserId(const std::string& user_id) const |
38 OVERRIDE; | 38 OVERRIDE; |
39 virtual std::string GetManagerDisplayEmail(const std::string& user_id) const | 39 virtual std::string GetManagerDisplayEmail(const std::string& user_id) const |
40 OVERRIDE; | 40 OVERRIDE; |
41 virtual void StartCreationTransaction(const string16& display_name) OVERRIDE; | 41 virtual void StartCreationTransaction(const base::string16& display_name) OVER
RIDE; |
42 virtual void SetCreationTransactionUserId(const std::string& user_id) | 42 virtual void SetCreationTransactionUserId(const std::string& user_id) |
43 OVERRIDE; | 43 OVERRIDE; |
44 virtual void CommitCreationTransaction() OVERRIDE; | 44 virtual void CommitCreationTransaction() OVERRIDE; |
45 | 45 |
46 private: | 46 private: |
47 friend class UserManager; | 47 friend class UserManager; |
48 friend class UserManagerImpl; | 48 friend class UserManagerImpl; |
49 | 49 |
50 explicit SupervisedUserManagerImpl(UserManagerImpl* owner); | 50 explicit SupervisedUserManagerImpl(UserManagerImpl* owner); |
51 | 51 |
52 // Returns true if there is non-committed user creation transaction. | 52 // Returns true if there is non-committed user creation transaction. |
53 bool HasFailedUserCreationTransaction(); | 53 bool HasFailedUserCreationTransaction(); |
54 | 54 |
55 // Attempts to clean up data that could be left from failed user creation. | 55 // Attempts to clean up data that could be left from failed user creation. |
56 void RollbackUserCreationTransaction(); | 56 void RollbackUserCreationTransaction(); |
57 | 57 |
58 void RemoveNonCryptohomeData(const std::string& user_id); | 58 void RemoveNonCryptohomeData(const std::string& user_id); |
59 | 59 |
60 bool CheckForFirstRun(const std::string& user_id); | 60 bool CheckForFirstRun(const std::string& user_id); |
61 | 61 |
62 // Update name if this user is manager of some managed users. | 62 // Update name if this user is manager of some managed users. |
63 void UpdateManagerName(const std::string& manager_id, | 63 void UpdateManagerName(const std::string& manager_id, |
64 const string16& new_display_name); | 64 const base::string16& new_display_name); |
65 | 65 |
66 UserManagerImpl* owner_; | 66 UserManagerImpl* owner_; |
67 | 67 |
68 // Interface to the signed settings store. | 68 // Interface to the signed settings store. |
69 CrosSettings* cros_settings_; | 69 CrosSettings* cros_settings_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(SupervisedUserManagerImpl); | 71 DISALLOW_COPY_AND_ASSIGN(SupervisedUserManagerImpl); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace chromeos | 74 } // namespace chromeos |
75 | 75 |
76 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_IMPL_H_ | 76 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_IMPL_H_ |
OLD | NEW |