| 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 "components/proximity_auth/proximity_auth_system.h" | 5 #include "components/proximity_auth/proximity_auth_system.h" |
| 6 | 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "base/time/default_clock.h" | 8 #include "base/time/default_clock.h" |
| 9 #include "components/proximity_auth/logging/logging.h" | 9 #include "components/proximity_auth/logging/logging.h" |
| 10 #include "components/proximity_auth/proximity_auth_client.h" | 10 #include "components/proximity_auth/proximity_auth_client.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 cryptauth::RemoteDeviceList ProximityAuthSystem::GetRemoteDevicesForUser( | 90 cryptauth::RemoteDeviceList ProximityAuthSystem::GetRemoteDevicesForUser( |
| 91 const AccountId& account_id) const { | 91 const AccountId& account_id) const { |
| 92 if (remote_devices_map_.find(account_id) == remote_devices_map_.end()) | 92 if (remote_devices_map_.find(account_id) == remote_devices_map_.end()) |
| 93 return cryptauth::RemoteDeviceList(); | 93 return cryptauth::RemoteDeviceList(); |
| 94 return remote_devices_map_.at(account_id); | 94 return remote_devices_map_.at(account_id); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void ProximityAuthSystem::OnAuthAttempted(const AccountId& /* account_id */) { | 97 void ProximityAuthSystem::OnAuthAttempted(const AccountId& /* account_id */) { |
| 98 // TODO(tengs): There is no reason to pass the |account_id| argument anymore. | 98 // TODO(tengs): There is no reason to pass the |account_id| argument anymore. |
| 99 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); | 99 unlock_manager_->OnAuthAttempted(mojom::AuthType::USER_CLICK); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void ProximityAuthSystem::OnSuspend() { | 102 void ProximityAuthSystem::OnSuspend() { |
| 103 PA_LOG(INFO) << "Preparing for device suspension."; | 103 PA_LOG(INFO) << "Preparing for device suspension."; |
| 104 DCHECK(!suspended_); | 104 DCHECK(!suspended_); |
| 105 suspended_ = true; | 105 suspended_ = true; |
| 106 unlock_manager_->SetRemoteDeviceLifeCycle(nullptr); | 106 unlock_manager_->SetRemoteDeviceLifeCycle(nullptr); |
| 107 remote_device_life_cycle_.reset(); | 107 remote_device_life_cycle_.reset(); |
| 108 } | 108 } |
| 109 | 109 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 PA_LOG(ERROR) << "Invalid last password timestamp: now=" << now_ms | 205 PA_LOG(ERROR) << "Invalid last password timestamp: now=" << now_ms |
| 206 << ", last_password=" << last_password_ms; | 206 << ", last_password=" << last_password_ms; |
| 207 return true; | 207 return true; |
| 208 } | 208 } |
| 209 | 209 |
| 210 return base::TimeDelta::FromMilliseconds(now_ms - last_password_ms) > | 210 return base::TimeDelta::FromMilliseconds(now_ms - last_password_ms) > |
| 211 base::TimeDelta::FromHours(kPasswordReauthPeriodHours); | 211 base::TimeDelta::FromHours(kPasswordReauthPeriodHours); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // proximity_auth | 214 } // proximity_auth |
| OLD | NEW |