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

Unified Diff: chrome/browser/printing/print_preview_data_service_factory.cc

Issue 7063030: PrintPreview: Print Preview is not staying associated with initiator renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 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/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;
+}

Powered by Google App Engine
This is Rietveld 408576698