| 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 8d205f2e8f612dbe0022e6adedd418e2fd96bb1f..8130f9b01f85f2e3bcc89bbc06f316c2f8572014 100644
|
| --- a/chrome/browser/signin/easy_unlock_service.cc
|
| +++ b/chrome/browser/signin/easy_unlock_service.cc
|
| @@ -22,6 +22,7 @@
|
| #include "chrome/common/extensions/extension_constants.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "components/pref_registry/pref_registry_syncable.h"
|
| +#include "components/user_manager/user.h"
|
| #include "device/bluetooth/bluetooth_adapter.h"
|
| #include "device/bluetooth/bluetooth_adapter_factory.h"
|
| #include "extensions/browser/event_router.h"
|
| @@ -31,6 +32,7 @@
|
| #include "grit/browser_resources.h"
|
|
|
| #if defined(OS_CHROMEOS)
|
| +#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| #include "chromeos/dbus/power_manager_client.h"
|
| #endif
|
| @@ -52,6 +54,19 @@ EasyUnlockService* EasyUnlockService::Get(Profile* profile) {
|
| return EasyUnlockServiceFactory::GetForProfile(profile);
|
| }
|
|
|
| +// static
|
| +EasyUnlockService* EasyUnlockService::GetForUser(
|
| + const user_manager::User& user) {
|
| +#if defined(OS_CHROMEOS)
|
| + Profile* profile = chromeos::ProfileHelper::Get()->GetProfileByUser(&user);
|
| + if (!profile)
|
| + return NULL;
|
| + return EasyUnlockService::Get(profile);
|
| +#else
|
| + return NULL;
|
| +#endif
|
| +}
|
| +
|
| class EasyUnlockService::BluetoothDetector
|
| : public device::BluetoothAdapter::Observer {
|
| public:
|
| @@ -197,6 +212,7 @@ EasyUnlockScreenlockStateHandler*
|
| if (!screenlock_state_handler_) {
|
| screenlock_state_handler_.reset(new EasyUnlockScreenlockStateHandler(
|
| GetUserEmail(),
|
| + IsHardlocked(),
|
| GetType() == TYPE_REGULAR ? profile_->GetPrefs() : NULL,
|
| ScreenlockBridge::Get()));
|
| }
|
| @@ -376,6 +392,13 @@ void EasyUnlockService::ResetScreenlockState() {
|
| auth_attempt_.reset();
|
| }
|
|
|
| +void EasyUnlockService::SetScreenlockHardlockedState(bool value) {
|
| + if (screenlock_state_handler_)
|
| + screenlock_state_handler_->SetHardlocked(value);
|
| + if (value)
|
| + auth_attempt_.reset();
|
| +}
|
| +
|
| void EasyUnlockService::Initialize() {
|
| InitializeInternal();
|
|
|
|
|