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

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

Issue 2715823004: Add FingerprintUnlock KeyedService for each profile (Closed)
Patch Set: rebase Created 3 years, 10 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
deleted file mode 100644
index 773bdf3804977e7332a474216b29a5bf54d5adaf..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#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 {
-namespace quick_unlock {
-
-// static
-PinStorage* PinStorageFactory::GetForProfile(Profile* profile) {
- return static_cast<PinStorage*>(
- GetInstance()->GetServiceForBrowserContext(profile, true));
-}
-
-// 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();
-}
-
-PinStorageFactory::PinStorageFactory()
- : BrowserContextKeyedServiceFactory(
- "PinStorageFactory",
- BrowserContextDependencyManager::GetInstance()) {}
-
-PinStorageFactory::~PinStorageFactory() {}
-
-KeyedService* PinStorageFactory::BuildServiceInstanceFor(
- content::BrowserContext* context) const {
- return new PinStorage(Profile::FromBrowserContext(context)->GetPrefs());
-}
-
-} // namespace quick_unlock
-} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698