| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/string_split.h" | 13 #include "base/string_split.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/win/windows_version.h" | 15 #include "base/win/windows_version.h" |
| 16 #include "chrome/common/child_process_logging.h" | 16 #include "chrome/common/child_process_logging.h" |
| 17 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
| 18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 19 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
| 20 #include "content/common/pepper_plugin_registry.h" | 20 #include "content/common/pepper_plugin_registry.h" |
| 21 #include "remoting/client/plugin/pepper_entrypoints.h" | 21 #include "remoting/client/plugin/pepper_entrypoints.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 24 #include "webkit/glue/user_agent.h" | 24 #include "webkit/glue/user_agent.h" |
| 25 #include "webkit/plugins/plugin_constants.h" |
| 25 | 26 |
| 26 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 27 #include "content/common/sandbox_policy.h" | 28 #include "content/common/sandbox_policy.h" |
| 28 #include "sandbox/src/sandbox.h" | 29 #include "sandbox/src/sandbox.h" |
| 29 #endif | 30 #endif |
| 30 | 31 |
| 31 #if !defined(NACL_WIN64) // The code this needs isn't linked on Win64 builds. | 32 #if !defined(NACL_WIN64) // The code this needs isn't linked on Win64 builds. |
| 32 #include "chrome/common/render_messages.h" | 33 #include "chrome/common/render_messages.h" |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 namespace { | 36 namespace { |
| 36 | |
| 37 const char* kPDFPluginName = "Chrome PDF Viewer"; | |
| 38 const char* kPDFPluginMimeType = "application/pdf"; | |
| 39 const char* kPDFPluginExtension = "pdf"; | |
| 40 const char* kPDFPluginDescription = "Portable Document Format"; | |
| 41 const char* kPDFPluginPrintPreviewMimeType | |
| 42 = "application/x-google-chrome-print-preview-pdf"; | |
| 43 | |
| 44 const char* kNaClPluginName = "Native Client"; | |
| 45 const char* kNaClPluginMimeType = "application/x-nacl"; | |
| 46 const char* kNaClPluginExtension = "nexe"; | |
| 47 const char* kNaClPluginDescription = "Native Client Executable"; | |
| 48 | |
| 49 const char* kNaClOldPluginName = "Chrome NaCl"; | |
| 50 | |
| 51 #if defined(ENABLE_REMOTING) | 37 #if defined(ENABLE_REMOTING) |
| 52 const char* kRemotingViewerPluginName = "Remoting Viewer"; | |
| 53 const FilePath::CharType kRemotingViewerPluginPath[] = | 38 const FilePath::CharType kRemotingViewerPluginPath[] = |
| 54 FILE_PATH_LITERAL("internal-remoting-viewer"); | 39 FILE_PATH_LITERAL("internal-remoting-viewer"); |
| 55 // Use a consistent MIME-type regardless of branding. | |
| 56 const char* kRemotingViewerPluginMimeType = | |
| 57 "application/vnd.chromium.remoting-viewer"; | |
| 58 // TODO(wez): Remove the old MIME-type once client code no longer needs it. | |
| 59 const char* kRemotingViewerPluginOldMimeType = | |
| 60 "pepper-application/x-chromoting"; | |
| 61 #endif | 40 #endif |
| 62 | 41 |
| 63 const char* kFlashPluginName = "Shockwave Flash"; | |
| 64 const char* kFlashPluginSwfMimeType = "application/x-shockwave-flash"; | |
| 65 const char* kFlashPluginSwfExtension = "swf"; | |
| 66 const char* kFlashPluginSwfDescription = "Shockwave Flash"; | |
| 67 const char* kFlashPluginSplMimeType = "application/futuresplash"; | |
| 68 const char* kFlashPluginSplExtension = "spl"; | |
| 69 const char* kFlashPluginSplDescription = "FutureSplash Player"; | |
| 70 | |
| 71 #if !defined(NACL_WIN64) // The code this needs isn't linked on Win64 builds. | 42 #if !defined(NACL_WIN64) // The code this needs isn't linked on Win64 builds. |
| 72 | |
| 73 // Appends the known built-in plugins to the given vector. Some built-in | 43 // Appends the known built-in plugins to the given vector. Some built-in |
| 74 // plugins are "internal" which means they are compiled into the Chrome binary, | 44 // plugins are "internal" which means they are compiled into the Chrome binary, |
| 75 // and some are extra shared libraries distributed with the browser (these are | 45 // and some are extra shared libraries distributed with the browser (these are |
| 76 // not marked internal, aside from being automatically registered, they're just | 46 // not marked internal, aside from being automatically registered, they're just |
| 77 // regular plugins). | 47 // regular plugins). |
| 78 void ComputeBuiltInPlugins(std::vector<PepperPluginInfo>* plugins) { | 48 void ComputeBuiltInPlugins(std::vector<PepperPluginInfo>* plugins) { |
| 79 // PDF. | 49 // PDF. |
| 80 // | 50 // |
| 81 // Once we're sandboxed, we can't know if the PDF plugin is available or not; | 51 // Once we're sandboxed, we can't know if the PDF plugin is available or not; |
| 82 // but (on Linux) this function is always called once before we're sandboxed. | 52 // but (on Linux) this function is always called once before we're sandboxed. |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); | 367 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); |
| 398 policy->SetTokenLevel( | 368 policy->SetTokenLevel( |
| 399 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); | 369 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); |
| 400 } | 370 } |
| 401 | 371 |
| 402 return true; | 372 return true; |
| 403 } | 373 } |
| 404 #endif | 374 #endif |
| 405 | 375 |
| 406 } // namespace chrome | 376 } // namespace chrome |
| OLD | NEW |