| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/base64url.h" | 9 #include "base/base64url.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 277 } |
| 278 | 278 |
| 279 void EasyUnlockServiceSignin::ShutdownInternal() { | 279 void EasyUnlockServiceSignin::ShutdownInternal() { |
| 280 if (!service_active_) | 280 if (!service_active_) |
| 281 return; | 281 return; |
| 282 service_active_ = false; | 282 service_active_ = false; |
| 283 | 283 |
| 284 weak_ptr_factory_.InvalidateWeakPtrs(); | 284 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 285 proximity_auth::ScreenlockBridge::Get()->RemoveObserver(this); | 285 proximity_auth::ScreenlockBridge::Get()->RemoveObserver(this); |
| 286 chromeos::LoginState::Get()->RemoveObserver(this); | 286 chromeos::LoginState::Get()->RemoveObserver(this); |
| 287 STLDeleteContainerPairSecondPointers(user_data_.begin(), user_data_.end()); | 287 base::STLDeleteContainerPairSecondPointers(user_data_.begin(), |
| 288 user_data_.end()); |
| 288 user_data_.clear(); | 289 user_data_.clear(); |
| 289 } | 290 } |
| 290 | 291 |
| 291 bool EasyUnlockServiceSignin::IsAllowedInternal() const { | 292 bool EasyUnlockServiceSignin::IsAllowedInternal() const { |
| 292 return service_active_ && account_id_.is_valid() && | 293 return service_active_ && account_id_.is_valid() && |
| 293 !chromeos::LoginState::Get()->IsUserLoggedIn(); | 294 !chromeos::LoginState::Get()->IsUserLoggedIn(); |
| 294 } | 295 } |
| 295 | 296 |
| 296 void EasyUnlockServiceSignin::OnWillFinalizeUnlock(bool success) { | 297 void EasyUnlockServiceSignin::OnWillFinalizeUnlock(bool success) { |
| 297 // This code path should only be exercised for the lock screen, not for the | 298 // This code path should only be exercised for the lock screen, not for the |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 if (!account_id_.is_valid()) | 470 if (!account_id_.is_valid()) |
| 470 return nullptr; | 471 return nullptr; |
| 471 | 472 |
| 472 const auto it = user_data_.find(account_id_); | 473 const auto it = user_data_.find(account_id_); |
| 473 if (it == user_data_.end()) | 474 if (it == user_data_.end()) |
| 474 return nullptr; | 475 return nullptr; |
| 475 if (it->second->state != USER_DATA_STATE_LOADED) | 476 if (it->second->state != USER_DATA_STATE_LOADED) |
| 476 return nullptr; | 477 return nullptr; |
| 477 return it->second; | 478 return it->second; |
| 478 } | 479 } |
| OLD | NEW |