| 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/signin/easy_unlock_service_signin_chromeos.h" | 5 #include "chrome/browser/signin/easy_unlock_service_signin_chromeos.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Loads device data list associated with the user's Easy unlock keys. | 81 // Loads device data list associated with the user's Easy unlock keys. |
| 82 void LoadDataForUser( | 82 void LoadDataForUser( |
| 83 const std::string& user_id, | 83 const std::string& user_id, |
| 84 uint32 backoff_ms, | 84 uint32 backoff_ms, |
| 85 const chromeos::EasyUnlockKeyManager::GetDeviceDataListCallback& callback) { | 85 const chromeos::EasyUnlockKeyManager::GetDeviceDataListCallback& callback) { |
| 86 chromeos::EasyUnlockKeyManager* key_manager = | 86 chromeos::EasyUnlockKeyManager* key_manager = |
| 87 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); | 87 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); |
| 88 DCHECK(key_manager); | 88 DCHECK(key_manager); |
| 89 | 89 |
| 90 key_manager->GetDeviceDataList( | 90 key_manager->GetDeviceDataList( |
| 91 chromeos::UserContext(user_id), | 91 chromeos::UserContext(AccountId::FromUserEmail(user_id)), |
| 92 base::Bind(&RetryDataLoadOnError, user_id, backoff_ms, callback)); | 92 base::Bind(&RetryDataLoadOnError, user_id, backoff_ms, callback)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace | 95 } // namespace |
| 96 | 96 |
| 97 EasyUnlockServiceSignin::UserData::UserData() | 97 EasyUnlockServiceSignin::UserData::UserData() |
| 98 : state(EasyUnlockServiceSignin::USER_DATA_STATE_INITIAL) { | 98 : state(EasyUnlockServiceSignin::USER_DATA_STATE_INITIAL) { |
| 99 } | 99 } |
| 100 | 100 |
| 101 EasyUnlockServiceSignin::UserData::~UserData() {} | 101 EasyUnlockServiceSignin::UserData::~UserData() {} |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 return NULL; | 455 return NULL; |
| 456 | 456 |
| 457 std::map<std::string, UserData*>::const_iterator it = | 457 std::map<std::string, UserData*>::const_iterator it = |
| 458 user_data_.find(user_id_); | 458 user_data_.find(user_id_); |
| 459 if (it == user_data_.end()) | 459 if (it == user_data_.end()) |
| 460 return NULL; | 460 return NULL; |
| 461 if (it->second->state != USER_DATA_STATE_LOADED) | 461 if (it->second->state != USER_DATA_STATE_LOADED) |
| 462 return NULL; | 462 return NULL; |
| 463 return it->second; | 463 return it->second; |
| 464 } | 464 } |
| OLD | NEW |