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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Loads device data list associated with the user's Easy unlock keys. | 78 // Loads device data list associated with the user's Easy unlock keys. |
79 void LoadDataForUser( | 79 void LoadDataForUser( |
80 const std::string& user_id, | 80 const std::string& user_id, |
81 uint32 backoff_ms, | 81 uint32 backoff_ms, |
82 const chromeos::EasyUnlockKeyManager::GetDeviceDataListCallback& callback) { | 82 const chromeos::EasyUnlockKeyManager::GetDeviceDataListCallback& callback) { |
83 chromeos::EasyUnlockKeyManager* key_manager = | 83 chromeos::EasyUnlockKeyManager* key_manager = |
84 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); | 84 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); |
85 DCHECK(key_manager); | 85 DCHECK(key_manager); |
86 | 86 |
87 key_manager->GetDeviceDataList( | 87 key_manager->GetDeviceDataList( |
88 chromeos::UserContext(user_id), | 88 chromeos::UserContext(AccountId::FromUserEmail(user_id)), |
89 base::Bind(&RetryDataLoadOnError, user_id, backoff_ms, callback)); | 89 base::Bind(&RetryDataLoadOnError, user_id, backoff_ms, callback)); |
90 } | 90 } |
91 | 91 |
92 } // namespace | 92 } // namespace |
93 | 93 |
94 EasyUnlockServiceSignin::UserData::UserData() | 94 EasyUnlockServiceSignin::UserData::UserData() |
95 : state(EasyUnlockServiceSignin::USER_DATA_STATE_INITIAL) { | 95 : state(EasyUnlockServiceSignin::USER_DATA_STATE_INITIAL) { |
96 } | 96 } |
97 | 97 |
98 EasyUnlockServiceSignin::UserData::~UserData() {} | 98 EasyUnlockServiceSignin::UserData::~UserData() {} |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 return NULL; | 422 return NULL; |
423 | 423 |
424 std::map<std::string, UserData*>::const_iterator it = | 424 std::map<std::string, UserData*>::const_iterator it = |
425 user_data_.find(user_id_); | 425 user_data_.find(user_id_); |
426 if (it == user_data_.end()) | 426 if (it == user_data_.end()) |
427 return NULL; | 427 return NULL; |
428 if (it->second->state != USER_DATA_STATE_LOADED) | 428 if (it->second->state != USER_DATA_STATE_LOADED) |
429 return NULL; | 429 return NULL; |
430 return it->second; | 430 return it->second; |
431 } | 431 } |
OLD | NEW |