Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4329)

Unified Diff: chrome/browser/signin/easy_unlock_service.cc

Issue 644873002: Easy Unlock Show connecting user pod icon when waking up from sleep (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/signin/easy_unlock_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/easy_unlock_service.cc
diff --git a/chrome/browser/signin/easy_unlock_service.cc b/chrome/browser/signin/easy_unlock_service.cc
index a5ee5179f3a26e477364e1da49a07f1f524335b1..a2e5fd82469a495c4b7ba0011bc5422809810d84 100644
--- a/chrome/browser/signin/easy_unlock_service.cc
+++ b/chrome/browser/signin/easy_unlock_service.cc
@@ -156,11 +156,14 @@ class EasyUnlockService::PowerMonitor
private:
// chromeos::PowerManagerClient::Observer:
virtual void SuspendImminent() override {
- service_->DisableAppIfLoaded();
+ service_->DisableAppIfLoaded(false /* don't reset screenlock state */);
+ service_->GetScreenlockStateHandler()->ChangeState(
+ EasyUnlockScreenlockStateHandler::STATE_BLUETOOTH_CONNECTING);
}
virtual void SuspendDone(const base::TimeDelta& sleep_duration) override {
- service_->LoadApp();
+ service_->UpdateAppState();
+ // Note that |this| may get deleted after |UpdateAppState| is called.
}
EasyUnlockService* service_;
@@ -229,8 +232,9 @@ bool EasyUnlockService::IsAllowed() {
return false;
#if defined(OS_CHROMEOS)
- if (!bluetooth_detector_->IsPresent())
+ if (bluetooth_detector_.get() && !bluetooth_detector_->IsPresent()) {
Tim Song 2014/10/10 06:46:14 Comment that bluetooth_detector_ is NULL if we suc
return false;
+ }
return true;
#else
@@ -419,9 +423,9 @@ void EasyUnlockService::LoadApp() {
#endif // defined(GOOGLE_CHROME_BUILD)
}
-void EasyUnlockService::DisableAppIfLoaded() {
- // Make sure lock screen state set by the extension gets reset.
- ResetScreenlockState();
+void EasyUnlockService::DisableAppIfLoaded(bool reset_screenlock_state) {
+ if (reset_screenlock_state)
+ ResetScreenlockState();
extensions::ComponentLoader* loader = GetComponentLoader(profile_);
if (!loader->Exists(extension_misc::kEasyUnlockAppId))
@@ -452,6 +456,13 @@ void EasyUnlockService::ReloadApp() {
void EasyUnlockService::UpdateAppState() {
if (IsAllowed()) {
+ // Bluetooth detector is used to make sure Easy Unlock is not enabled on
+ // devices that do not support Bluetooth. If Easy Unlock is allowed, that
+ // means that the bluetooth is supported on the device, so bluetooth
+ // detector is not needed any more (and might actually prolong time needed
+ // for the app to get reloaded after suspend).
+ bluetooth_detector_.reset();
tbarzic 2014/10/10 01:12:54 Let me know if you don't like this and I'll try to
Tim Song 2014/10/10 06:46:14 I'm fine with this, and improving the start-up tim
xiyuan 2014/10/10 15:45:53 The detector is kept around to support devices tha
tbarzic 2014/10/10 17:59:43 Yeah, I though there may be a reason for keeping d
+
LoadApp();
#if defined(OS_CHROMEOS)
@@ -459,7 +470,7 @@ void EasyUnlockService::UpdateAppState() {
power_monitor_.reset(new PowerMonitor(this));
#endif
} else {
- DisableAppIfLoaded();
+ DisableAppIfLoaded(true /* reset screenlock state */);
#if defined(OS_CHROMEOS)
power_monitor_.reset();
#endif
« no previous file with comments | « chrome/browser/signin/easy_unlock_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698