| 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 a9005303ae869e556cc34f16dbd9b4dad49002fa..0e25be41f159149d3da0808810787319da69682c 100644
|
| --- a/chrome/browser/signin/easy_unlock_service.cc
|
| +++ b/chrome/browser/signin/easy_unlock_service.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/command_line.h"
|
| +#include "base/guid.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram_macros.h"
|
| #include "base/prefs/pref_registry_simple.h"
|
| @@ -240,8 +241,9 @@ void EasyUnlockService::RegisterProfilePrefs(
|
|
|
| // static
|
| void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) {
|
| - registry->RegisterDictionaryPref(prefs::kEasyUnlockLocalStateUserPrefs);
|
| + registry->RegisterStringPref(prefs::kEasyUnlockDeviceId, std::string());
|
| registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState);
|
| + registry->RegisterDictionaryPref(prefs::kEasyUnlockLocalStateUserPrefs);
|
| #if defined(OS_CHROMEOS)
|
| EasyUnlockTpmKeyManager::RegisterLocalStatePrefs(registry);
|
| #endif
|
| @@ -290,6 +292,21 @@ EasyUnlockService::UserSettings EasyUnlockService::GetUserSettings(
|
| return user_settings;
|
| }
|
|
|
| +// static
|
| +std::string EasyUnlockService::GetDeviceId() {
|
| + PrefService* local_state = GetLocalState();
|
| + if (!local_state)
|
| + return std::string();
|
| +
|
| + std::string device_id =
|
| + local_state->GetString(prefs::kEasyUnlockDeviceId);
|
| + if (device_id.empty()) {
|
| + device_id = base::GenerateGUID();
|
| + local_state->SetString(prefs::kEasyUnlockDeviceId, device_id);
|
| + }
|
| + return device_id;
|
| +}
|
| +
|
| bool EasyUnlockService::IsAllowed() {
|
| if (shut_down_)
|
| return false;
|
|
|