| 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/chromeos/login/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 return; | 1043 return; |
| 1044 | 1044 |
| 1045 const base::ListValue* device_list = NULL; | 1045 const base::ListValue* device_list = NULL; |
| 1046 EasyUnlockService* easy_unlock_service = EasyUnlockService::GetForUser(*user); | 1046 EasyUnlockService* easy_unlock_service = EasyUnlockService::GetForUser(*user); |
| 1047 if (easy_unlock_service) { | 1047 if (easy_unlock_service) { |
| 1048 device_list = easy_unlock_service->GetRemoteDevices(); | 1048 device_list = easy_unlock_service->GetRemoteDevices(); |
| 1049 easy_unlock_service->SetHardlockState( | 1049 easy_unlock_service->SetHardlockState( |
| 1050 EasyUnlockScreenlockStateHandler::NO_HARDLOCK); | 1050 EasyUnlockScreenlockStateHandler::NO_HARDLOCK); |
| 1051 } | 1051 } |
| 1052 | 1052 |
| 1053 EasyUnlockKeyManager* key_manager = GetEasyUnlockKeyManager(); |
| 1053 running_easy_unlock_key_ops_ = true; | 1054 running_easy_unlock_key_ops_ = true; |
| 1054 if (device_list) { | 1055 if (device_list) { |
| 1055 easy_unlock_key_manager_->RefreshKeys( | 1056 key_manager->RefreshKeys( |
| 1056 user_context, | 1057 user_context, |
| 1057 *device_list, | 1058 *device_list, |
| 1058 base::Bind(&UserSessionManager::OnEasyUnlockKeyOpsFinished, | 1059 base::Bind(&UserSessionManager::OnEasyUnlockKeyOpsFinished, |
| 1059 AsWeakPtr(), | 1060 AsWeakPtr(), |
| 1060 user_context.GetUserID())); | 1061 user_context.GetUserID())); |
| 1061 } else { | 1062 } else { |
| 1062 easy_unlock_key_manager_->RemoveKeys( | 1063 key_manager->RemoveKeys( |
| 1063 user_context, | 1064 user_context, |
| 1064 0, | 1065 0, |
| 1065 base::Bind(&UserSessionManager::OnEasyUnlockKeyOpsFinished, | 1066 base::Bind(&UserSessionManager::OnEasyUnlockKeyOpsFinished, |
| 1066 AsWeakPtr(), | 1067 AsWeakPtr(), |
| 1067 user_context.GetUserID())); | 1068 user_context.GetUserID())); |
| 1068 } | 1069 } |
| 1069 } | 1070 } |
| 1070 | 1071 |
| 1071 void UserSessionManager::OnEasyUnlockKeyOpsFinished( | 1072 void UserSessionManager::OnEasyUnlockKeyOpsFinished( |
| 1072 const std::string& user_id, | 1073 const std::string& user_id, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 } | 1109 } |
| 1109 | 1110 |
| 1110 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() { | 1111 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() { |
| 1111 if (!easy_unlock_key_manager_) | 1112 if (!easy_unlock_key_manager_) |
| 1112 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); | 1113 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); |
| 1113 | 1114 |
| 1114 return easy_unlock_key_manager_.get(); | 1115 return easy_unlock_key_manager_.get(); |
| 1115 } | 1116 } |
| 1116 | 1117 |
| 1117 } // namespace chromeos | 1118 } // namespace chromeos |
| OLD | NEW |