| 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_MANAGED_MANAGED_USER_CREATION_CONTROLLER_N
EW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_MANAGED_USER_CREATION_CONTROLLER_N
EW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_MANAGED_USER_CREATION_CONTROLLER_N
EW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_MANAGED_USER_CREATION_CONTROLLER_N
EW_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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/chromeos/login/auth/extended_authenticator.h" | 16 #include "chrome/browser/chromeos/login/auth/extended_authenticator.h" |
| 17 #include "chrome/browser/chromeos/login/managed/managed_user_creation_controller
.h" | 17 #include "chrome/browser/chromeos/login/managed/managed_user_creation_controller
.h" |
| 18 #include "chrome/browser/managed_mode/managed_user_registration_utility.h" | 18 #include "chrome/browser/supervised_user/supervised_user_registration_utility.h" |
| 19 | 19 |
| 20 class Profile; | 20 class Profile; |
| 21 | 21 |
| 22 namespace chromeos { | 22 namespace chromeos { |
| 23 | 23 |
| 24 class UserContext; | 24 class UserContext; |
| 25 | 25 |
| 26 // LMU Creation process: | 26 // LMU Creation process: |
| 27 // 0. Manager is logged in | 27 // 0. Manager is logged in |
| 28 // 1. Generate ID for new LMU | 28 // 1. Generate ID for new LMU |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 std::string salted_master_key; // Hash(system salt + master key) | 135 std::string salted_master_key; // Hash(system salt + master key) |
| 136 std::string mount_hash; | 136 std::string mount_hash; |
| 137 | 137 |
| 138 std::string token; | 138 std::string token; |
| 139 | 139 |
| 140 CreationType creation_type; | 140 CreationType creation_type; |
| 141 | 141 |
| 142 base::DictionaryValue password_data; | 142 base::DictionaryValue password_data; |
| 143 | 143 |
| 144 Profile* manager_profile; | 144 Profile* manager_profile; |
| 145 scoped_ptr<ManagedUserRegistrationUtility> registration_utility; | 145 scoped_ptr<SupervisedUserRegistrationUtility> registration_utility; |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 // ManagedUserAuthenticator::StatusConsumer overrides. | 148 // ManagedUserAuthenticator::StatusConsumer overrides. |
| 149 virtual void OnAuthenticationFailure(ExtendedAuthenticator::AuthState error) | 149 virtual void OnAuthenticationFailure(ExtendedAuthenticator::AuthState error) |
| 150 OVERRIDE; | 150 OVERRIDE; |
| 151 | 151 |
| 152 // Authenticator success callbacks. | 152 // Authenticator success callbacks. |
| 153 void OnMountSuccess(const std::string& mount_hash); | 153 void OnMountSuccess(const std::string& mount_hash); |
| 154 void OnAddKeySuccess(); | 154 void OnAddKeySuccess(); |
| 155 void OnKeyTransformedIfNeeded(const UserContext& user_context); | 155 void OnKeyTransformedIfNeeded(const UserContext& user_context); |
| 156 | 156 |
| 157 void StartCreationImpl(); | 157 void StartCreationImpl(); |
| 158 | 158 |
| 159 // Guard timer callback. | 159 // Guard timer callback. |
| 160 void CreationTimedOut(); | 160 void CreationTimedOut(); |
| 161 // ManagedUserRegistrationUtility callback. | 161 // SupervisedUserRegistrationUtility callback. |
| 162 void RegistrationCallback(const GoogleServiceAuthError& error, | 162 void RegistrationCallback(const GoogleServiceAuthError& error, |
| 163 const std::string& token); | 163 const std::string& token); |
| 164 | 164 |
| 165 // Completion callback for StoreManagedUserFiles method. | 165 // Completion callback for StoreManagedUserFiles method. |
| 166 // Called on the UI thread. | 166 // Called on the UI thread. |
| 167 void OnManagedUserFilesStored(bool success); | 167 void OnManagedUserFilesStored(bool success); |
| 168 | 168 |
| 169 // Pointer to the current instance of the controller to be used by | 169 // Pointer to the current instance of the controller to be used by |
| 170 // automation tests. | 170 // automation tests. |
| 171 static ManagedUserCreationControllerNew* current_controller_; | 171 static ManagedUserCreationControllerNew* current_controller_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 184 | 184 |
| 185 // Factory of callbacks. | 185 // Factory of callbacks. |
| 186 base::WeakPtrFactory<ManagedUserCreationControllerNew> weak_factory_; | 186 base::WeakPtrFactory<ManagedUserCreationControllerNew> weak_factory_; |
| 187 | 187 |
| 188 DISALLOW_COPY_AND_ASSIGN(ManagedUserCreationControllerNew); | 188 DISALLOW_COPY_AND_ASSIGN(ManagedUserCreationControllerNew); |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 } // namespace chromeos | 191 } // namespace chromeos |
| 192 | 192 |
| 193 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_MANAGED_USER_CREATION_CONTROLLE
R_NEW_H_ | 193 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_MANAGED_USER_CREATION_CONTROLLE
R_NEW_H_ |
| OLD | NEW |