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

Unified Diff: athena/main/athena_content_client.cc

Issue 484873004: athena: Add support for PDF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 6 years, 4 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
« no previous file with comments | « athena/main/athena_content_client.h ('k') | athena/main/athena_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/main/athena_content_client.cc
diff --git a/athena/main/athena_content_client.cc b/athena/main/athena_content_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f24574ff5f9bfa1f98ce86e84279a7e8e34ead22
--- /dev/null
+++ b/athena/main/athena_content_client.cc
@@ -0,0 +1,52 @@
+// Copyright 2014 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 "athena/main/athena_content_client.h"
+
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "content/public/common/pepper_plugin_info.h"
+#include "ppapi/shared_impl/ppapi_permissions.h"
+
+namespace athena {
+
+AthenaContentClient::AthenaContentClient() {}
+
+AthenaContentClient::~AthenaContentClient() {}
+
+void AthenaContentClient::AddPepperPlugins(
+ std::vector<content::PepperPluginInfo>* plugins) {
+ const char kPDFPluginMimeType[] = "application/pdf";
+ const char kPDFPluginExtension[] = "pdf";
+ const char kPDFPluginDescription[] = "Portable Document Format";
+ const char kPDFPluginPrintPreviewMimeType[] =
+ "application/x-google-chrome-print-preview-pdf";
+ const uint32 kPDFPluginPermissions =
+ ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV;
+ const char kPDFPluginName[] = "Chrome PDF Viewer";
+ const base::FilePath::CharType kPDFPluginFileName[] =
+ FILE_PATH_LITERAL("libpdf.so");
+
+ base::FilePath module;
+ if (!PathService::Get(base::DIR_MODULE, &module))
+ return;
+
+ content::PepperPluginInfo pdf;
+ pdf.path = base::FilePath(module.Append(kPDFPluginFileName));
+ pdf.name = kPDFPluginName;
+ content::WebPluginMimeType pdf_mime_type(
+ kPDFPluginMimeType, kPDFPluginExtension, kPDFPluginDescription);
+ content::WebPluginMimeType print_preview_pdf_mime_type(
+ kPDFPluginPrintPreviewMimeType,
+ kPDFPluginExtension,
+ kPDFPluginDescription);
+ pdf.mime_types.push_back(pdf_mime_type);
+ pdf.mime_types.push_back(print_preview_pdf_mime_type);
+ pdf.permissions = kPDFPluginPermissions;
+ plugins->push_back(pdf);
+
+ ShellContentClient::AddPepperPlugins(plugins);
+}
+
+} // namespace athena
« no previous file with comments | « athena/main/athena_content_client.h ('k') | athena/main/athena_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698