| 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 "apps/app_lifetime_monitor.h" | 7 #include "apps/app_lifetime_monitor.h" |
| 8 #include "apps/app_lifetime_monitor_factory.h" | 8 #include "apps/app_lifetime_monitor_factory.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 void SuspendImminent() override { service_->PrepareForSuspend(); } | 220 void SuspendImminent() override { service_->PrepareForSuspend(); } |
| 221 | 221 |
| 222 void SuspendDone(const base::TimeDelta& sleep_duration) override { | 222 void SuspendDone(const base::TimeDelta& sleep_duration) override { |
| 223 waking_up_ = true; | 223 waking_up_ = true; |
| 224 wake_up_time_ = base::Time::Now(); | 224 wake_up_time_ = base::Time::Now(); |
| 225 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 225 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 226 FROM_HERE, | 226 FROM_HERE, |
| 227 base::Bind(&PowerMonitor::ResetWakingUp, | 227 base::Bind(&PowerMonitor::ResetWakingUp, |
| 228 weak_ptr_factory_.GetWeakPtr()), | 228 weak_ptr_factory_.GetWeakPtr()), |
| 229 base::TimeDelta::FromSeconds(5)); | 229 base::TimeDelta::FromSeconds(5)); |
| 230 service_->OnSuspendDone(); |
| 230 service_->UpdateAppState(); | 231 service_->UpdateAppState(); |
| 231 // Note that |this| may get deleted after |UpdateAppState| is called. | 232 // Note that |this| may get deleted after |UpdateAppState| is called. |
| 232 } | 233 } |
| 233 | 234 |
| 234 void ResetWakingUp() { | 235 void ResetWakingUp() { |
| 235 waking_up_ = false; | 236 waking_up_ = false; |
| 236 service_->UpdateAppState(); | 237 service_->UpdateAppState(); |
| 237 } | 238 } |
| 238 | 239 |
| 239 EasyUnlockService* service_; | 240 EasyUnlockService* service_; |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 857 |
| 857 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 858 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 858 // failed. | 859 // failed. |
| 859 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 860 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 860 ->PrepareTpmKey(true /* check_private_key */, | 861 ->PrepareTpmKey(true /* check_private_key */, |
| 861 base::Closure()); | 862 base::Closure()); |
| 862 #endif // defined(OS_CHROMEOS) | 863 #endif // defined(OS_CHROMEOS) |
| 863 | 864 |
| 864 tpm_key_checked_ = true; | 865 tpm_key_checked_ = true; |
| 865 } | 866 } |
| OLD | NEW |