Chromium Code Reviews| Index: chrome/browser/signin/easy_unlock_service_signin_chromeos.cc |
| diff --git a/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc b/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc |
| index e30ee9298818ddfda639a3aeb4211d0dcbf57893..050d072c3779d733146eb85fe3a26750e1506f7a 100644 |
| --- a/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc |
| +++ b/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc |
| @@ -18,6 +18,9 @@ |
| #include "chrome/browser/signin/easy_unlock_metrics.h" |
| #include "chromeos/login/auth/user_context.h" |
| #include "chromeos/tpm/tpm_token_loader.h" |
| +#include "components/proximity_auth/cryptauth/base64url.h" |
| +#include "components/proximity_auth/logging/logging.h" |
| +#include "components/proximity_auth/remote_device.h" |
| namespace { |
| @@ -253,7 +256,7 @@ void EasyUnlockServiceSignin::OnWillFinalizeUnlock(bool success) { |
| NOTREACHED(); |
| } |
| -void EasyUnlockServiceSignin::OnSuspendDone() { |
| +void EasyUnlockServiceSignin::OnSuspendDoneInternal() { |
| // Ignored. |
| } |
| @@ -377,6 +380,26 @@ void EasyUnlockServiceSignin::OnUserDataLoaded( |
| // that it has to refresh it's user data. |
| if (user_id == user_id_) |
| NotifyUserUpdated(); |
| + |
| + if (user_id != user_id || devices.empty()) |
| + return; |
| + |
| + // TODO(tengs): Currently, ProximityAuthSystem only supports one device. Once |
| + // multiple devices are supported, we need to load all devices. |
| + std::string decoded_public_key, decoded_psk, decoded_challenge; |
| + proximity_auth::Base64UrlDecode(devices[0].public_key, &decoded_public_key); |
| + proximity_auth::Base64UrlDecode(devices[0].psk, &decoded_psk); |
| + proximity_auth::Base64UrlDecode(devices[0].challenge, &decoded_challenge); |
| + proximity_auth::RemoteDevice remote_device( |
| + user_id, std::string(), decoded_public_key, devices[0].bluetooth_address, |
| + decoded_psk); |
| + remote_device.sign_in_challenge = decoded_challenge; |
| + PA_LOG(ERROR) << "Loaded Remote Device:\n" |
|
sacomoto
2015/09/29 18:45:57
nit: s/ERROR/INFO/.
Tim Song
2015/09/30 00:05:04
Done.
|
| + << " user id: " << remote_device.user_id << "\n" |
| + << " name: " << remote_device.name << "\n" |
| + << " public key" << devices[0].public_key << "\n" |
| + << " bt_addr:" << remote_device.bluetooth_address; |
| + OnRemoteDeviceChanged(&remote_device); |
| } |
| const EasyUnlockServiceSignin::UserData* |