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 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/cpu.h" | 8 #include "base/cpu.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
27 #include "components/nacl/common/nacl_process_type.h" | 27 #include "components/nacl/common/nacl_process_type.h" |
28 #include "content/public/common/content_constants.h" | 28 #include "content/public/common/content_constants.h" |
29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
30 #include "content/public/common/pepper_plugin_info.h" | 30 #include "content/public/common/pepper_plugin_info.h" |
31 #include "content/public/common/url_constants.h" | 31 #include "content/public/common/url_constants.h" |
32 #include "content/public/common/user_agent.h" | 32 #include "content/public/common/user_agent.h" |
33 #include "extensions/common/constants.h" | 33 #include "extensions/common/constants.h" |
34 #include "gpu/config/gpu_info.h" | 34 #include "gpu/config/gpu_info.h" |
35 #include "grit/common_resources.h" | 35 #include "grit/common_resources.h" |
| 36 #include "ppapi/native_client/src/trusted/plugin/ppapi_entrypoints.h" |
36 #include "ppapi/shared_impl/ppapi_permissions.h" | 37 #include "ppapi/shared_impl/ppapi_permissions.h" |
37 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
38 #include "ui/base/layout.h" | 39 #include "ui/base/layout.h" |
39 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
40 | 41 |
41 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. | 42 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. |
42 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 43 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
43 | 44 |
44 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
45 #include "base/win/registry.h" | 46 #include "base/win/registry.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 skip_pdf_file_check = true; | 165 skip_pdf_file_check = true; |
165 } | 166 } |
166 } | 167 } |
167 | 168 |
168 // Handle Native Client just like the PDF plugin. This means that it is | 169 // Handle Native Client just like the PDF plugin. This means that it is |
169 // enabled by default for the non-portable case. This allows apps installed | 170 // enabled by default for the non-portable case. This allows apps installed |
170 // from the Chrome Web Store to use NaCl even if the command line switch | 171 // from the Chrome Web Store to use NaCl even if the command line switch |
171 // isn't set. For other uses of NaCl we check for the command line switch. | 172 // isn't set. For other uses of NaCl we check for the command line switch. |
172 // Specifically, Portable Native Client is only enabled by the command line | 173 // Specifically, Portable Native Client is only enabled by the command line |
173 // switch. | 174 // switch. |
174 static bool skip_nacl_file_check = false; | |
175 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { | 175 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { |
176 if (skip_nacl_file_check || base::PathExists(path)) { | 176 content::PepperPluginInfo nacl; |
177 content::PepperPluginInfo nacl; | 177 // The nacl plugin is now built into the Chromium binary. |
178 nacl.path = path; | 178 nacl.is_internal = true; |
179 nacl.name = ChromeContentClient::kNaClPluginName; | 179 nacl.path = path; |
180 content::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, | 180 nacl.name = ChromeContentClient::kNaClPluginName; |
181 kNaClPluginExtension, | 181 content::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, |
182 kNaClPluginDescription); | 182 kNaClPluginExtension, |
183 nacl.mime_types.push_back(nacl_mime_type); | 183 kNaClPluginDescription); |
184 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 184 nacl.mime_types.push_back(nacl_mime_type); |
185 switches::kDisablePnacl)) { | 185 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
186 content::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType, | 186 switches::kDisablePnacl)) { |
187 kPnaclPluginExtension, | 187 content::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType, |
188 kPnaclPluginDescription); | 188 kPnaclPluginExtension, |
189 nacl.mime_types.push_back(pnacl_mime_type); | 189 kPnaclPluginDescription); |
190 } | 190 nacl.mime_types.push_back(pnacl_mime_type); |
191 nacl.permissions = kNaClPluginPermissions; | |
192 plugins->push_back(nacl); | |
193 | |
194 skip_nacl_file_check = true; | |
195 } | 191 } |
| 192 nacl.internal_entry_points.get_interface = nacl_plugin::PPP_GetInterface; |
| 193 nacl.internal_entry_points.initialize_module = |
| 194 nacl_plugin::PPP_InitializeModule; |
| 195 nacl.internal_entry_points.shutdown_module = |
| 196 nacl_plugin::PPP_ShutdownModule; |
| 197 nacl.permissions = kNaClPluginPermissions; |
| 198 plugins->push_back(nacl); |
196 } | 199 } |
197 | 200 |
198 static bool skip_o1d_file_check = false; | 201 static bool skip_o1d_file_check = false; |
199 if (PathService::Get(chrome::FILE_O1D_PLUGIN, &path)) { | 202 if (PathService::Get(chrome::FILE_O1D_PLUGIN, &path)) { |
200 if (skip_o1d_file_check || base::PathExists(path)) { | 203 if (skip_o1d_file_check || base::PathExists(path)) { |
201 content::PepperPluginInfo o1d; | 204 content::PepperPluginInfo o1d; |
202 o1d.path = path; | 205 o1d.path = path; |
203 o1d.name = kO1DPluginName; | 206 o1d.name = kO1DPluginName; |
204 o1d.is_out_of_process = true; | 207 o1d.is_out_of_process = true; |
205 o1d.is_sandboxed = false; | 208 o1d.is_sandboxed = false; |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 int sandbox_type, | 535 int sandbox_type, |
533 int* sandbox_profile_resource_id) const { | 536 int* sandbox_profile_resource_id) const { |
534 DCHECK(sandbox_profile_resource_id); | 537 DCHECK(sandbox_profile_resource_id); |
535 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { | 538 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { |
536 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 539 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
537 return true; | 540 return true; |
538 } | 541 } |
539 return false; | 542 return false; |
540 } | 543 } |
541 #endif | 544 #endif |
OLD | NEW |