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

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

Issue 1977923002: Implement pin storage backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Rebase Created 4 years, 7 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
new file mode 100644
index 0000000000000000000000000000000000000000..2bebcc47e9c9ec61c9ab02e52b1c05f7267d7a49
--- /dev/null
+++ b/chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.cc
@@ -0,0 +1,36 @@
+// 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/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+namespace chromeos {
+
+// static
+PinStorage* PinStorageFactory::GetForProfile(Profile* profile) {
+ return static_cast<PinStorage*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// 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 chromeos

Powered by Google App Engine
This is Rietveld 408576698