Index: chrome/browser/download/download_service_factory.cc |
diff --git a/chrome/browser/download/download_service_factory.cc b/chrome/browser/download/download_service_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2ac64e6aefcec15764cd99148cc28199b75e86a0 |
--- /dev/null |
+++ b/chrome/browser/download/download_service_factory.cc |
@@ -0,0 +1,48 @@ |
+// Copyright (c) 2011 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/download/download_service_factory.h" |
+ |
+#include "chrome/browser/download/download_service.h" |
+#include "chrome/browser/profiles/profile_dependency_manager.h" |
+ |
+// static |
+DownloadService* DownloadServiceFactory::GetForProfile( |
+ Profile* profile) { |
+ return static_cast<DownloadService*>( |
+ GetInstance()->GetServiceForProfile(profile, true)); |
+} |
+ |
+// static |
+DownloadServiceFactory* DownloadServiceFactory::GetInstance() { |
+ return Singleton<DownloadServiceFactory>::get(); |
+} |
+ |
+DownloadServiceFactory::DownloadServiceFactory() |
+ : ProfileKeyedServiceFactory( |
+ ProfileDependencyManager::GetInstance()) { |
+ // TODO(rdsmith): For Shutdown() order we need to: |
+ // DependsOn(HistoryServiceDataFactory::GetInstance()); |
+} |
+ |
+DownloadServiceFactory::~DownloadServiceFactory() { |
+} |
+ |
+ProfileKeyedService* DownloadServiceFactory::BuildServiceInstanceFor( |
+ Profile* profile) const { |
+ DownloadService* service = new DownloadService(profile); |
+ |
+ // No need for initialization; initialization can be done on first |
+ // use of service. |
+ |
+ return service; |
+} |
+ |
+bool DownloadServiceFactory::ServiceHasOwnInstanceInIncognito() { |
+ return true; |
+} |
+ |
+bool DownloadServiceFactory::ServiceIsNULLWhileTesting() { |
+ return true; |
+} |