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

Unified Diff: chrome/browser/chromeos/printing/ppd_provider_factory.cc

Issue 2542363002: Interrogate PpdProvider from PrintPreview. (Closed)
Patch Set: address comment from dpapad@ Created 4 years 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/printing/ppd_provider_factory.cc
diff --git a/chrome/browser/chromeos/printing/ppd_provider_factory.cc b/chrome/browser/chromeos/printing/ppd_provider_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4c06d9a7f3e72ecc17b9d737d103dbe18297a65e
--- /dev/null
+++ b/chrome/browser/chromeos/printing/ppd_provider_factory.cc
@@ -0,0 +1,33 @@
+// Copyright 2016 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/printing/ppd_provider_factory.h"
+
+#include <memory>
+
+#include "base/files/file_path.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chromeos/printing/ppd_cache.h"
+#include "chromeos/printing/ppd_provider.h"
+#include "content/public/browser/browser_thread.h"
+#include "google_apis/google_api_keys.h"
+#include "net/url_request/url_request_context_getter.h"
+
+namespace chromeos {
+namespace printing {
+
+std::unique_ptr<PpdProvider> CreateProvider(Profile* profile) {
+ base::FilePath ppd_cache_path =
+ profile->GetPath().Append(FILE_PATH_LITERAL("PPDCache"));
+
+ return PpdProvider::Create(google_apis::GetAPIKey(),
+ g_browser_process->system_request_context(),
+ content::BrowserThread::GetTaskRunnerForThread(
+ content::BrowserThread::FILE),
+ PpdCache::Create(ppd_cache_path));
+}
+
+} // namespace printing
+} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/printing/ppd_provider_factory.h ('k') | chrome/browser/ui/webui/print_preview/print_preview_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698