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

Unified Diff: chrome/common/chrome_content_client.cc

Issue 96233002: Add a PDF component extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | chrome/common/extensions/api/_manifest_features.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_content_client.cc
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 9040894548791e64c3257c4afc1dd057a736233f..c7ec36993fa11af34c23b0aff162d41649cc365c 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -62,8 +62,10 @@ namespace {
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 char kPDFPluginPrintPreviewMimeType[] =
+ "application/x-google-chrome-print-preview-pdf";
+const char kPDFPluginOutOfProcessMimeType[] =
+ "application/x-google-chrome-pdf";
const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_DEV;
@@ -149,20 +151,26 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
content::PepperPluginInfo pdf;
pdf.path = path;
pdf.name = ChromeContentClient::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;
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kOutOfProcessPdf)) {
pdf.is_out_of_process = true;
+ content::WebPluginMimeType pdf_mime_type(kPDFPluginOutOfProcessMimeType,
+ kPDFPluginExtension,
+ kPDFPluginDescription);
+ pdf.mime_types.push_back(pdf_mime_type);
+ // TODO(raymes): Make print preview work with out of process PDF.
+ } else {
+ 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);
skip_pdf_file_check = true;
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | chrome/common/extensions/api/_manifest_features.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698