Index: chrome/browser/printing/print_preview_data_service_factory.cc |
diff --git a/chrome/browser/printing/print_preview_data_service_factory.cc b/chrome/browser/printing/print_preview_data_service_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4cb4c52475578cdd971bb480fb1b0629c39d2a93 |
--- /dev/null |
+++ b/chrome/browser/printing/print_preview_data_service_factory.cc |
@@ -0,0 +1,37 @@ |
+// 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/printing/print_preview_data_service_factory.h" |
+ |
+#include "chrome/browser/printing/print_preview_data_service.h" |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/profiles/profile_dependency_manager.h" |
+ |
+// static |
+PrintPreviewDataService* PrintPreviewDataServiceFactory::GetForProfile( |
+ Profile* profile) { |
+ return static_cast<PrintPreviewDataService*>( |
+ GetInstance()->GetServiceForProfile(profile, true)); |
+} |
+ |
+// static |
+PrintPreviewDataServiceFactory* PrintPreviewDataServiceFactory::GetInstance() { |
+ return Singleton<PrintPreviewDataServiceFactory>::get(); |
+} |
+ |
+PrintPreviewDataServiceFactory::PrintPreviewDataServiceFactory() |
+ : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { |
+} |
+ |
+PrintPreviewDataServiceFactory::~PrintPreviewDataServiceFactory() { |
+} |
+ |
+ProfileKeyedService* PrintPreviewDataServiceFactory::BuildServiceInstanceFor( |
+ Profile* profile) const { |
+ return new PrintPreviewDataService(); |
+} |
+ |
+bool PrintPreviewDataServiceFactory::ServiceHasOwnInstanceInIncognito() { |
+ return true; |
+} |