Index: chrome/browser/chromeos/certificate_provider/certificate_provider_service_factory.cc |
diff --git a/chrome/browser/chromeos/certificate_provider/certificate_provider_service_factory.cc b/chrome/browser/chromeos/certificate_provider/certificate_provider_service_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..89c3d5366fe44c0b43c6ef642dbf7d4125a08336 |
--- /dev/null |
+++ b/chrome/browser/chromeos/certificate_provider/certificate_provider_service_factory.cc |
@@ -0,0 +1,55 @@ |
+// Copyright 2015 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/certificate_provider/certificate_provider_service_factory.h" |
+ |
+#include "base/logging.h" |
+#include "base/memory/singleton.h" |
+#include "chrome/browser/chromeos/certificate_provider/certificate_provider_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" |
+#include "content/public/browser/browser_thread.h" |
+ |
+// #include "extensions/browser/extension_registry.h" |
+ |
+namespace chromeos { |
+ |
+// static |
+CertificateProviderService* |
+CertificateProviderServiceFactory::GetForBrowserContext( |
+ content::BrowserContext* context) { |
+ return static_cast<CertificateProviderService*>( |
+ GetInstance()->GetServiceForBrowserContext(context, true)); |
+} |
+ |
+// static |
+CertificateProviderServiceFactory* |
+CertificateProviderServiceFactory::GetInstance() { |
+ return Singleton<CertificateProviderServiceFactory>::get(); |
+} |
+ |
+CertificateProviderServiceFactory::CertificateProviderServiceFactory() |
+ : BrowserContextKeyedServiceFactory( |
+ "CertificateProviderService", |
+ BrowserContextDependencyManager::GetInstance()) { |
+ DependsOn(extensions::ExtensionSystemFactory::GetInstance()); |
+} |
+ |
+CertificateProviderServiceFactory::~CertificateProviderServiceFactory() {} |
+ |
+content::BrowserContext* |
+CertificateProviderServiceFactory::GetBrowserContextToUse( |
+ content::BrowserContext* context) const { |
+ return chrome::GetBrowserContextRedirectedInIncognito(context); |
+} |
+ |
+KeyedService* CertificateProviderServiceFactory::BuildServiceInstanceFor( |
+ content::BrowserContext* context) const { |
+ return new CertificateProviderService( |
+ content::BrowserThread::GetMessageLoopProxyForThread( |
+ content::BrowserThread::IO)); |
+} |
+ |
+} // namespace chromeos |