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/managed/supervised_user_authentication.h " | |
12 #include "chrome/browser/chromeos/login/supervised_user_manager.h" | 13 #include "chrome/browser/chromeos/login/supervised_user_manager.h" |
13 | 14 |
14 namespace chromeos { | 15 namespace chromeos { |
15 | 16 |
16 class CrosSettings; | 17 class CrosSettings; |
17 class UserManagerImpl; | 18 class UserManagerImpl; |
18 | 19 |
19 // Implementation of the UserManager. | 20 // Implementation of the UserManager. |
20 class SupervisedUserManagerImpl | 21 class SupervisedUserManagerImpl |
21 : public SupervisedUserManager { | 22 : public SupervisedUserManager { |
(...skipping 13 matching lines...) Expand all Loading... | |
35 virtual string16 GetManagerDisplayName(const std::string& user_id) const | 36 virtual string16 GetManagerDisplayName(const std::string& user_id) const |
36 OVERRIDE; | 37 OVERRIDE; |
37 virtual std::string GetManagerUserId(const std::string& user_id) const | 38 virtual std::string GetManagerUserId(const std::string& user_id) const |
38 OVERRIDE; | 39 OVERRIDE; |
39 virtual std::string GetManagerDisplayEmail(const std::string& user_id) const | 40 virtual std::string GetManagerDisplayEmail(const std::string& user_id) const |
40 OVERRIDE; | 41 OVERRIDE; |
41 virtual void StartCreationTransaction(const string16& display_name) OVERRIDE; | 42 virtual void StartCreationTransaction(const string16& display_name) OVERRIDE; |
42 virtual void SetCreationTransactionUserId(const std::string& user_id) | 43 virtual void SetCreationTransactionUserId(const std::string& user_id) |
43 OVERRIDE; | 44 OVERRIDE; |
44 virtual void CommitCreationTransaction() OVERRIDE; | 45 virtual void CommitCreationTransaction() OVERRIDE; |
46 virtual SupervisedUserAuthentication* GetSupervisedUserAuthentication() | |
47 OVERRIDE; | |
48 virtual void GetPasswordInformation(const std::string& user_id, | |
49 base::DictionaryValue* result) OVERRIDE; | |
50 virtual void SetPasswordInformation( | |
51 const std::string& user_id, | |
52 const base::DictionaryValue* password_info) OVERRIDE; | |
45 | 53 |
46 private: | 54 private: |
47 friend class UserManager; | 55 friend class UserManager; |
48 friend class UserManagerImpl; | 56 friend class UserManagerImpl; |
49 | 57 |
50 explicit SupervisedUserManagerImpl(UserManagerImpl* owner); | 58 explicit SupervisedUserManagerImpl(UserManagerImpl* owner); |
51 | 59 |
52 // Returns true if there is non-committed user creation transaction. | 60 // Returns true if there is non-committed user creation transaction. |
53 bool HasFailedUserCreationTransaction(); | 61 bool HasFailedUserCreationTransaction(); |
54 | 62 |
55 // Attempts to clean up data that could be left from failed user creation. | 63 // Attempts to clean up data that could be left from failed user creation. |
56 void RollbackUserCreationTransaction(); | 64 void RollbackUserCreationTransaction(); |
57 | 65 |
58 void RemoveNonCryptohomeData(const std::string& user_id); | 66 void RemoveNonCryptohomeData(const std::string& user_id); |
59 | 67 |
60 bool CheckForFirstRun(const std::string& user_id); | 68 bool CheckForFirstRun(const std::string& user_id); |
61 | 69 |
62 // Update name if this user is manager of some managed users. | 70 // Update name if this user is manager of some managed users. |
63 void UpdateManagerName(const std::string& manager_id, | 71 void UpdateManagerName(const std::string& manager_id, |
64 const string16& new_display_name); | 72 const string16& new_display_name); |
65 | 73 |
74 bool GetUserValue(const std::string& user_id, | |
Nikita (slow)
2013/12/09 16:42:16
nit: Please add comments for these new functions.
| |
75 const char* key, | |
76 std::string* out_value) const; | |
77 | |
78 void SetUserValue(const std::string& user_id, | |
79 const char* key, | |
80 const std::string& value); | |
81 | |
82 void CleanPref(const std::string& user_id, | |
83 const char* key); | |
84 | |
66 UserManagerImpl* owner_; | 85 UserManagerImpl* owner_; |
67 | 86 |
68 // Interface to the signed settings store. | 87 // Interface to the signed settings store. |
69 CrosSettings* cros_settings_; | 88 CrosSettings* cros_settings_; |
70 | 89 |
90 scoped_ptr<SupervisedUserAuthentication> authentication_; | |
91 | |
71 DISALLOW_COPY_AND_ASSIGN(SupervisedUserManagerImpl); | 92 DISALLOW_COPY_AND_ASSIGN(SupervisedUserManagerImpl); |
72 }; | 93 }; |
73 | 94 |
74 } // namespace chromeos | 95 } // namespace chromeos |
75 | 96 |
76 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_IMPL_H_ | 97 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_IMPL_H_ |
OLD | NEW |