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 #include "chrome/browser/managed_mode/chromeos/manager_password_service.h" | 5 #include "chrome/browser/managed_mode/chromeos/manager_password_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chromeos/login/managed/locally_managed_user_constants.h " | 10 #include "chrome/browser/chromeos/login/managed/locally_managed_user_constants.h " |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 VLOG(0) << "Password changed for " << user_id; | 185 VLOG(0) << "Password changed for " << user_id; |
186 UMA_HISTOGRAM_ENUMERATION( | 186 UMA_HISTOGRAM_ENUMERATION( |
187 "ManagedUsers.ChromeOS.PasswordChange", | 187 "ManagedUsers.ChromeOS.PasswordChange", |
188 SupervisedUserAuthentication::PASSWORD_CHANGED_IN_MANAGER_SESSION, | 188 SupervisedUserAuthentication::PASSWORD_CHANGED_IN_MANAGER_SESSION, |
189 SupervisedUserAuthentication::PASSWORD_CHANGE_RESULT_MAX_VALUE); | 189 SupervisedUserAuthentication::PASSWORD_CHANGE_RESULT_MAX_VALUE); |
190 | 190 |
191 SupervisedUserAuthentication* auth = | 191 SupervisedUserAuthentication* auth = |
192 UserManager::Get()->GetSupervisedUserManager()->GetAuthentication(); | 192 UserManager::Get()->GetSupervisedUserManager()->GetAuthentication(); |
193 int old_schema = auth->GetPasswordSchema(user_id); | 193 int old_schema = auth->GetPasswordSchema(user_id); |
194 auth->StorePasswordData(user_id, *password_data.get()); | 194 auth->StorePasswordData(user_id, *password_data.get()); |
195 if (auth->HasIncompleteKey(user_id)) { | |
Bernhard Bauer
2014/04/02 14:05:28
From looking at the rest of the code in this file,
Nikita (slow)
2014/04/02 14:18:20
nit: drop {}
Nikita (slow)
2014/04/02 14:18:20
nit: Please add comment that you're essentially ma
Denis Kuznetsov (DE-MUC)
2014/04/02 14:48:51
Done.
| |
196 auth->MarkKeyIncomplete(user_id, false); | |
Nikita (slow)
2014/04/02 14:18:20
nit: false /* incomplete */
| |
197 } | |
198 // Check if we have legacy labels for keys. | |
Nikita (slow)
2014/04/02 14:18:20
nit: Insert empty line.
Denis Kuznetsov (DE-MUC)
2014/04/02 14:48:51
Done.
| |
199 // TODO(antrim): migrate it to GetLabels call once wad@ implement it. | |
Nikita (slow)
2014/04/02 14:18:20
nit: Capitalize comment.
Denis Kuznetsov (DE-MUC)
2014/04/02 14:48:51
Done.
| |
195 if (old_schema == SupervisedUserAuthentication::SCHEMA_PLAIN) { | 200 if (old_schema == SupervisedUserAuthentication::SCHEMA_PLAIN) { |
196 // 1) Add new manager key (using old key). | 201 // 1) Add new manager key (using old key). |
197 // 2) Remove old supervised user key. | 202 // 2) Remove old supervised user key. |
198 // 3) Remove old manager key. | 203 // 3) Remove old manager key. |
199 authenticator_->TransformContext( | 204 authenticator_->TransformContext( |
200 master_key_context, | 205 master_key_context, |
201 base::Bind(&ManagerPasswordService::OnContextTransformed, | 206 base::Bind(&ManagerPasswordService::OnContextTransformed, |
202 weak_ptr_factory_.GetWeakPtr())); | 207 weak_ptr_factory_.GetWeakPtr())); |
203 } | 208 } |
204 } | 209 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 void ManagerPasswordService::OnOldManagerKeyDeleted( | 252 void ManagerPasswordService::OnOldManagerKeyDeleted( |
248 const UserContext& master_key_context) { | 253 const UserContext& master_key_context) { |
249 VLOG(1) << "Removed old master key for " << master_key_context.username; | 254 VLOG(1) << "Removed old master key for " << master_key_context.username; |
250 } | 255 } |
251 | 256 |
252 void ManagerPasswordService::Shutdown() { | 257 void ManagerPasswordService::Shutdown() { |
253 settings_service_subscription_.reset(); | 258 settings_service_subscription_.reset(); |
254 } | 259 } |
255 | 260 |
256 } // namespace chromeos | 261 } // namespace chromeos |
OLD | NEW |