| 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.h" | 5 #include "chrome/browser/signin/easy_unlock_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 key_manager->GetDeviceDataList( | 493 key_manager->GetDeviceDataList( |
| 494 chromeos::UserContext(user_id), | 494 chromeos::UserContext(user_id), |
| 495 base::Bind(&EasyUnlockService::OnCryptohomeKeysFetchedForChecking, | 495 base::Bind(&EasyUnlockService::OnCryptohomeKeysFetchedForChecking, |
| 496 weak_ptr_factory_.GetWeakPtr(), | 496 weak_ptr_factory_.GetWeakPtr(), |
| 497 user_id, | 497 user_id, |
| 498 paired_devices)); | 498 paired_devices)); |
| 499 #endif | 499 #endif |
| 500 } | 500 } |
| 501 | 501 |
| 502 void EasyUnlockService::SetTrialRun() { | 502 void EasyUnlockService::SetTrialRun() { |
| 503 DCHECK(GetType() == TYPE_REGULAR); | 503 DCHECK_EQ(GetType(), TYPE_REGULAR); |
| 504 | 504 |
| 505 EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); | 505 EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); |
| 506 if (handler) | 506 if (handler) |
| 507 handler->SetTrialRun(); | 507 handler->SetTrialRun(); |
| 508 } | 508 } |
| 509 | 509 |
| 510 void EasyUnlockService::RecordClickOnLockIcon() { |
| 511 if (screenlock_state_handler_) |
| 512 screenlock_state_handler_->RecordClickOnLockIcon(); |
| 513 } |
| 514 |
| 510 void EasyUnlockService::AddObserver(EasyUnlockServiceObserver* observer) { | 515 void EasyUnlockService::AddObserver(EasyUnlockServiceObserver* observer) { |
| 511 observers_.AddObserver(observer); | 516 observers_.AddObserver(observer); |
| 512 } | 517 } |
| 513 | 518 |
| 514 void EasyUnlockService::RemoveObserver(EasyUnlockServiceObserver* observer) { | 519 void EasyUnlockService::RemoveObserver(EasyUnlockServiceObserver* observer) { |
| 515 observers_.RemoveObserver(observer); | 520 observers_.RemoveObserver(observer); |
| 516 } | 521 } |
| 517 | 522 |
| 518 void EasyUnlockService::Shutdown() { | 523 void EasyUnlockService::Shutdown() { |
| 519 if (shut_down_) | 524 if (shut_down_) |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 749 |
| 745 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 750 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 746 // failed. | 751 // failed. |
| 747 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 752 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 748 ->PrepareTpmKey(true /* check_private_key */, | 753 ->PrepareTpmKey(true /* check_private_key */, |
| 749 base::Closure()); | 754 base::Closure()); |
| 750 #endif // defined(OS_CHROMEOS) | 755 #endif // defined(OS_CHROMEOS) |
| 751 | 756 |
| 752 tpm_key_checked_ = true; | 757 tpm_key_checked_ = true; |
| 753 } | 758 } |
| OLD | NEW |