Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Side by Side Diff: components/proximity_auth/proximity_auth_system.cc

Issue 2937553002: Create Mojo Struct for user information used in login/lock screen. (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/proximity_auth/fake_lock_handler.cc ('k') | components/proximity_auth/proximity_auth_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698