OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #endif // defined(OS_LINUX) | 9 #endif // defined(OS_LINUX) |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #endif | 67 #endif |
68 | 68 |
69 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \ | 69 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \ |
70 !defined(WIDEVINE_CDM_IS_COMPONENT) | 70 !defined(WIDEVINE_CDM_IS_COMPONENT) |
71 #include "chrome/common/widevine_cdm_constants.h" | 71 #include "chrome/common/widevine_cdm_constants.h" |
72 #endif | 72 #endif |
73 | 73 |
74 namespace { | 74 namespace { |
75 | 75 |
76 #if defined(ENABLE_PLUGINS) | 76 #if defined(ENABLE_PLUGINS) |
| 77 #if defined(ENABLE_PDF) |
77 const char kPDFPluginExtension[] = "pdf"; | 78 const char kPDFPluginExtension[] = "pdf"; |
78 const char kPDFPluginDescription[] = "Portable Document Format"; | 79 const char kPDFPluginDescription[] = "Portable Document Format"; |
79 const char kPDFPluginOutOfProcessMimeType[] = | 80 const char kPDFPluginOutOfProcessMimeType[] = |
80 "application/x-google-chrome-pdf"; | 81 "application/x-google-chrome-pdf"; |
81 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | | 82 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | |
82 ppapi::PERMISSION_DEV; | 83 ppapi::PERMISSION_DEV; |
| 84 #endif // defined(ENABLE_PDF) |
83 | 85 |
84 content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface; | 86 content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface; |
85 content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module; | 87 content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module; |
86 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module; | 88 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module; |
87 | 89 |
88 #if !defined(DISABLE_NACL) | 90 #if !defined(DISABLE_NACL) |
89 content::PepperPluginInfo::GetInterfaceFunc g_nacl_get_interface; | 91 content::PepperPluginInfo::GetInterfaceFunc g_nacl_get_interface; |
90 content::PepperPluginInfo::PPP_InitializeModuleFunc g_nacl_initialize_module; | 92 content::PepperPluginInfo::PPP_InitializeModuleFunc g_nacl_initialize_module; |
91 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module; | 93 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module; |
92 #endif | 94 #endif |
93 | 95 |
94 // Appends the known built-in plugins to the given vector. Some built-in | 96 // Appends the known built-in plugins to the given vector. Some built-in |
95 // plugins are "internal" which means they are compiled into the Chrome binary, | 97 // plugins are "internal" which means they are compiled into the Chrome binary, |
96 // and some are extra shared libraries distributed with the browser (these are | 98 // and some are extra shared libraries distributed with the browser (these are |
97 // not marked internal, aside from being automatically registered, they're just | 99 // not marked internal, aside from being automatically registered, they're just |
98 // regular plugins). | 100 // regular plugins). |
99 void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { | 101 void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { |
| 102 #if defined(ENABLE_PDF) |
100 content::PepperPluginInfo pdf_info; | 103 content::PepperPluginInfo pdf_info; |
101 pdf_info.is_internal = true; | 104 pdf_info.is_internal = true; |
102 pdf_info.is_out_of_process = true; | 105 pdf_info.is_out_of_process = true; |
103 pdf_info.name = ChromeContentClient::kPDFPluginName; | 106 pdf_info.name = ChromeContentClient::kPDFPluginName; |
104 pdf_info.description = kPDFPluginDescription; | 107 pdf_info.description = kPDFPluginDescription; |
105 pdf_info.path = base::FilePath::FromUTF8Unsafe( | 108 pdf_info.path = base::FilePath::FromUTF8Unsafe( |
106 ChromeContentClient::kPDFPluginPath); | 109 ChromeContentClient::kPDFPluginPath); |
107 content::WebPluginMimeType pdf_mime_type( | 110 content::WebPluginMimeType pdf_mime_type( |
108 kPDFPluginOutOfProcessMimeType, | 111 kPDFPluginOutOfProcessMimeType, |
109 kPDFPluginExtension, | 112 kPDFPluginExtension, |
110 kPDFPluginDescription); | 113 kPDFPluginDescription); |
111 pdf_info.mime_types.push_back(pdf_mime_type); | 114 pdf_info.mime_types.push_back(pdf_mime_type); |
112 pdf_info.internal_entry_points.get_interface = g_pdf_get_interface; | 115 pdf_info.internal_entry_points.get_interface = g_pdf_get_interface; |
113 pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module; | 116 pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module; |
114 pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module; | 117 pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module; |
115 pdf_info.permissions = kPDFPluginPermissions; | 118 pdf_info.permissions = kPDFPluginPermissions; |
116 plugins->push_back(pdf_info); | 119 plugins->push_back(pdf_info); |
| 120 #endif // defined(ENABLE_PDF) |
117 | 121 |
118 base::FilePath path; | 122 base::FilePath path; |
119 | 123 |
120 #if !defined(DISABLE_NACL) | 124 #if !defined(DISABLE_NACL) |
121 // Handle Native Client just like the PDF plugin. This means that it is | 125 // Handle Native Client just like the PDF plugin. This means that it is |
122 // enabled by default for the non-portable case. This allows apps installed | 126 // enabled by default for the non-portable case. This allows apps installed |
123 // from the Chrome Web Store to use NaCl even if the command line switch | 127 // from the Chrome Web Store to use NaCl even if the command line switch |
124 // isn't set. For other uses of NaCl we check for the command line switch. | 128 // isn't set. For other uses of NaCl we check for the command line switch. |
125 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { | 129 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { |
126 content::PepperPluginInfo nacl; | 130 content::PepperPluginInfo nacl; |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 schemes->insert(content::kChromeUIScheme); | 603 schemes->insert(content::kChromeUIScheme); |
600 schemes->insert(extensions::kExtensionScheme); | 604 schemes->insert(extensions::kExtensionScheme); |
601 schemes->insert(extensions::kExtensionResourceScheme); | 605 schemes->insert(extensions::kExtensionResourceScheme); |
602 GetSecureOriginWhitelist(origins); | 606 GetSecureOriginWhitelist(origins); |
603 } | 607 } |
604 | 608 |
605 void ChromeContentClient::AddServiceWorkerSchemes( | 609 void ChromeContentClient::AddServiceWorkerSchemes( |
606 std::set<std::string>* schemes) { | 610 std::set<std::string>* schemes) { |
607 schemes->insert(extensions::kExtensionScheme); | 611 schemes->insert(extensions::kExtensionScheme); |
608 } | 612 } |
OLD | NEW |