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

Unified Diff: chrome/browser/chromeos/platform_keys/platform_keys_service_factory.cc

Issue 323093003: Add the Sign-At-Most-Once restriction the enterprise.platformKeys API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 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/platform_keys/platform_keys_service_factory.cc
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys_service_factory.cc b/chrome/browser/chromeos/platform_keys/platform_keys_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a1098056505785f2d602a3c5a88b59ccb6bc0945
--- /dev/null
+++ b/chrome/browser/chromeos/platform_keys/platform_keys_service_factory.cc
@@ -0,0 +1,51 @@
+// Copyright 2014 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/platform_keys/platform_keys_service_factory.h"
+
+#include "base/logging.h"
+#include "base/memory/singleton.h"
+#include "chrome/browser/chromeos/platform_keys/platform_keys_service.h"
+#include "chrome/browser/extensions/extension_system_factory.h"
+#include "chrome/browser/profiles/incognito_helpers.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+namespace chromeos {
+
+// static
+PlatformKeysService* PlatformKeysServiceFactory::GetForBrowserContext(
+ content::BrowserContext* context) {
+ return static_cast<PlatformKeysService*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+// static
+PlatformKeysServiceFactory* PlatformKeysServiceFactory::GetInstance() {
+ return Singleton<PlatformKeysServiceFactory>::get();
+}
+
+PlatformKeysServiceFactory::PlatformKeysServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "PlatformKeysService",
+ BrowserContextDependencyManager::GetInstance()) {
+ DependsOn(extensions::ExtensionSystemFactory::GetInstance());
+}
+
+PlatformKeysServiceFactory::~PlatformKeysServiceFactory() {
+}
+
+content::BrowserContext* PlatformKeysServiceFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return chrome::GetBrowserContextRedirectedInIncognito(context);
+}
+
+KeyedService* PlatformKeysServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ extensions::StateStore* store =
+ extensions::ExtensionSystem::Get(context)->state_store();
+ DCHECK(store);
+ return new PlatformKeysService(store);
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698