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/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 return; | 277 return; |
278 service_active_ = false; | 278 service_active_ = false; |
279 | 279 |
280 weak_ptr_factory_.InvalidateWeakPtrs(); | 280 weak_ptr_factory_.InvalidateWeakPtrs(); |
281 ScreenlockBridge::Get()->RemoveObserver(this); | 281 ScreenlockBridge::Get()->RemoveObserver(this); |
282 chromeos::LoginState::Get()->RemoveObserver(this); | 282 chromeos::LoginState::Get()->RemoveObserver(this); |
283 STLDeleteContainerPairSecondPointers(user_data_.begin(), user_data_.end()); | 283 STLDeleteContainerPairSecondPointers(user_data_.begin(), user_data_.end()); |
284 user_data_.clear(); | 284 user_data_.clear(); |
285 } | 285 } |
286 | 286 |
287 bool EasyUnlockServiceSignin::IsAllowedInternal() { | 287 bool EasyUnlockServiceSignin::IsAllowedInternal() const { |
288 return service_active_ && | 288 return service_active_ && |
289 !user_id_.empty() && | 289 !user_id_.empty() && |
290 !chromeos::LoginState::Get()->IsUserLoggedIn(); | 290 !chromeos::LoginState::Get()->IsUserLoggedIn(); |
291 } | 291 } |
292 | 292 |
293 void EasyUnlockServiceSignin::OnScreenDidLock() { | 293 void EasyUnlockServiceSignin::OnScreenDidLock() { |
294 // Update initial UI is when the account picker on login screen is ready. | 294 // Update initial UI is when the account picker on login screen is ready. |
295 ShowInitialUserState(); | 295 ShowInitialUserState(); |
296 } | 296 } |
297 | 297 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 return NULL; | 388 return NULL; |
389 | 389 |
390 std::map<std::string, UserData*>::const_iterator it = | 390 std::map<std::string, UserData*>::const_iterator it = |
391 user_data_.find(user_id_); | 391 user_data_.find(user_id_); |
392 if (it == user_data_.end()) | 392 if (it == user_data_.end()) |
393 return NULL; | 393 return NULL; |
394 if (it->second->state != USER_DATA_STATE_LOADED) | 394 if (it->second->state != USER_DATA_STATE_LOADED) |
395 return NULL; | 395 return NULL; |
396 return it->second; | 396 return it->second; |
397 } | 397 } |
OLD | NEW |