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

Unified Diff: chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.cc

Issue 2015413002: Enable the PIN keyboard on the lockscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Address comments Created 4 years, 6 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
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();
}

Powered by Google App Engine
This is Rietveld 408576698