| Index: chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.cc
|
| diff --git a/chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.cc b/chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.cc
|
| index 2bebcc47e9c9ec61c9ab02e52b1c05f7267d7a49..4548dbb8e57abb90ab00b94333e6d1229931103b 100644
|
| --- a/chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.cc
|
| +++ b/chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.cc
|
| @@ -5,8 +5,11 @@
|
| #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h"
|
|
|
| #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h"
|
| +#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "components/keyed_service/content/browser_context_dependency_manager.h"
|
| +#include "components/user_manager/user.h"
|
| +#include "components/user_manager/user_manager.h"
|
|
|
| namespace chromeos {
|
|
|
| @@ -17,6 +20,25 @@ PinStorage* PinStorageFactory::GetForProfile(Profile* profile) {
|
| }
|
|
|
| // static
|
| +PinStorage* PinStorageFactory::GetForUser(const user_manager::User* user) {
|
| + Profile* profile = ProfileHelper::Get()->GetProfileByUser(user);
|
| + if (!profile)
|
| + return nullptr;
|
| +
|
| + return GetForProfile(profile);
|
| +}
|
| +
|
| +// static
|
| +PinStorage* PinStorageFactory::GetForAccountId(const AccountId& account_id) {
|
| + const user_manager::User* user =
|
| + user_manager::UserManager::Get()->FindUser(account_id);
|
| + if (!user)
|
| + return nullptr;
|
| +
|
| + return GetForUser(user);
|
| +}
|
| +
|
| +// static
|
| PinStorageFactory* PinStorageFactory::GetInstance() {
|
| return base::Singleton<PinStorageFactory>::get();
|
| }
|
|
|