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 CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_CONTRO
LLER_NEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_CONTRO
LLER_NEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_CONTRO
LLER_NEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_CONTRO
LLER_NEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // 7. Mark "transaction" as completed. | 34 // 7. Mark "transaction" as completed. |
35 // 8. End manager session. | 35 // 8. End manager session. |
36 class SupervisedUserCreationControllerNew | 36 class SupervisedUserCreationControllerNew |
37 : public SupervisedUserCreationController, | 37 : public SupervisedUserCreationController, |
38 public ExtendedAuthenticator::NewAuthStatusConsumer { | 38 public ExtendedAuthenticator::NewAuthStatusConsumer { |
39 public: | 39 public: |
40 // All UI initialization is deferred till Init() call. | 40 // All UI initialization is deferred till Init() call. |
41 // |Consumer| is not owned by controller, and it is expected that it wouldn't | 41 // |Consumer| is not owned by controller, and it is expected that it wouldn't |
42 // be deleted before SupervisedUserCreationControllerNew. | 42 // be deleted before SupervisedUserCreationControllerNew. |
43 SupervisedUserCreationControllerNew(StatusConsumer* consumer, | 43 SupervisedUserCreationControllerNew(StatusConsumer* consumer, |
44 const std::string& manager_id); | 44 const user_manager::UserID& manager_id); |
45 ~SupervisedUserCreationControllerNew() override; | 45 ~SupervisedUserCreationControllerNew() override; |
46 | 46 |
47 // Returns the current supervised user controller if it has been created. | 47 // Returns the current supervised user controller if it has been created. |
48 static SupervisedUserCreationControllerNew* current_controller() { | 48 static SupervisedUserCreationControllerNew* current_controller() { |
49 return current_controller_; | 49 return current_controller_; |
50 } | 50 } |
51 | 51 |
52 // Set up controller for creating new supervised user with |display_name|, | 52 // Set up controller for creating new supervised user with |display_name|, |
53 // |password| and avatar indexed by |avatar_index|. StartCreation() have to | 53 // |password| and avatar indexed by |avatar_index|. StartCreation() have to |
54 // be called to actually start creating user. | 54 // be called to actually start creating user. |
(...skipping 23 matching lines...) Expand all Loading... |
78 const std::string& master_key, | 78 const std::string& master_key, |
79 const base::DictionaryValue* password_data, | 79 const base::DictionaryValue* password_data, |
80 const std::string& encryption_key, | 80 const std::string& encryption_key, |
81 const std::string& signature_key) override; | 81 const std::string& signature_key) override; |
82 | 82 |
83 void SetManagerProfile(Profile* manager_profile) override; | 83 void SetManagerProfile(Profile* manager_profile) override; |
84 Profile* GetManagerProfile() override; | 84 Profile* GetManagerProfile() override; |
85 | 85 |
86 void CancelCreation() override; | 86 void CancelCreation() override; |
87 void FinishCreation() override; | 87 void FinishCreation() override; |
88 std::string GetSupervisedUserId() override; | 88 const user_manager::UserID& GetSupervisedUserId() const override; |
89 | 89 |
90 private: | 90 private: |
91 enum Stage { | 91 enum Stage { |
92 // Just initial stage. | 92 // Just initial stage. |
93 STAGE_INITIAL, | 93 STAGE_INITIAL, |
94 | 94 |
95 // Creation attempt is recoreded to allow cleanup in case of failure. | 95 // Creation attempt is recoreded to allow cleanup in case of failure. |
96 TRANSACTION_STARTED, | 96 TRANSACTION_STARTED, |
97 // Different keys are generated and public ones are stored in LocalState. | 97 // Different keys are generated and public ones are stored in LocalState. |
98 KEYS_GENERATED, | 98 KEYS_GENERATED, |
(...skipping 13 matching lines...) Expand all Loading... |
112 enum CreationType { NEW_USER, USER_IMPORT_OLD, USER_IMPORT_NEW, }; | 112 enum CreationType { NEW_USER, USER_IMPORT_OLD, USER_IMPORT_NEW, }; |
113 | 113 |
114 // Contains information necessary for new user creation. | 114 // Contains information necessary for new user creation. |
115 struct UserCreationContext { | 115 struct UserCreationContext { |
116 UserCreationContext(); | 116 UserCreationContext(); |
117 ~UserCreationContext(); | 117 ~UserCreationContext(); |
118 | 118 |
119 base::string16 display_name; | 119 base::string16 display_name; |
120 int avatar_index; | 120 int avatar_index; |
121 | 121 |
122 std::string manager_id; | 122 user_manager::UserID manager_id; |
123 | 123 |
124 std::string local_user_id; // Used to identify cryptohome. | 124 user_manager::UserID local_user_id; // Used to identify cryptohome. |
125 std::string sync_user_id; // Used to identify user in manager's sync data. | 125 std::string sync_user_id; // Used to identify user in manager's sync data. |
126 | 126 |
127 // Keys: | 127 // Keys: |
128 std::string master_key; // Random string | 128 std::string master_key; // Random string |
129 std::string signature_key; // 256 bit HMAC key | 129 std::string signature_key; // 256 bit HMAC key |
130 std::string encryption_key; // 256 bit HMAC key | 130 std::string encryption_key; // 256 bit HMAC key |
131 std::string salted_password; // Hash(salt + Hash(password)) | 131 std::string salted_password; // Hash(salt + Hash(password)) |
132 | 132 |
133 std::string password; | 133 std::string password; |
134 | 134 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 // Factory of callbacks. | 184 // Factory of callbacks. |
185 base::WeakPtrFactory<SupervisedUserCreationControllerNew> weak_factory_; | 185 base::WeakPtrFactory<SupervisedUserCreationControllerNew> weak_factory_; |
186 | 186 |
187 DISALLOW_COPY_AND_ASSIGN(SupervisedUserCreationControllerNew); | 187 DISALLOW_COPY_AND_ASSIGN(SupervisedUserCreationControllerNew); |
188 }; | 188 }; |
189 | 189 |
190 } // namespace chromeos | 190 } // namespace chromeos |
191 | 191 |
192 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_CON
TROLLER_NEW_H_ | 192 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_CON
TROLLER_NEW_H_ |
OLD | NEW |