| 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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 const char kPDFPluginPrintPreviewMimeType | 44 const char kPDFPluginPrintPreviewMimeType |
| 45 [] = "application/x-google-chrome-print-preview-pdf"; | 45 [] = "application/x-google-chrome-print-preview-pdf"; |
| 46 | 46 |
| 47 const char kNaClPluginName[] = "Native Client"; | 47 const char kNaClPluginName[] = "Native Client"; |
| 48 const char kNaClPluginMimeType[] = "application/x-nacl"; | 48 const char kNaClPluginMimeType[] = "application/x-nacl"; |
| 49 const char kNaClPluginExtension[] = "nexe"; | 49 const char kNaClPluginExtension[] = "nexe"; |
| 50 const char kNaClPluginDescription[] = "Native Client Executable"; | 50 const char kNaClPluginDescription[] = "Native Client Executable"; |
| 51 | 51 |
| 52 const char kNaClOldPluginName[] = "Chrome NaCl"; | 52 const char kNaClOldPluginName[] = "Chrome NaCl"; |
| 53 | 53 |
| 54 const char kO3DPluginName[] = "Google Talk Plugin Video Accelerator"; |
| 55 const char kO3DPluginMimeType[] ="application/vnd.o3d.auto"; |
| 56 const char kO3DPluginExtension[] = ""; |
| 57 const char kO3DPluginDescription[] = "O3D MIME"; |
| 58 |
| 59 const char kGTalkPluginName[] = "Google Talk Plugin"; |
| 60 const char kGTalkPluginMimeType[] ="application/googletalk"; |
| 61 const char kGTalkPluginExtension[] = ".googletalk"; |
| 62 const char kGTalkPluginDescription[] = "Google Talk Plugin"; |
| 63 |
| 54 #if defined(ENABLE_REMOTING) | 64 #if defined(ENABLE_REMOTING) |
| 55 const char kRemotingViewerPluginName[] = "Remoting Viewer"; | 65 const char kRemotingViewerPluginName[] = "Remoting Viewer"; |
| 56 const FilePath::CharType kRemotingViewerPluginPath[] = | 66 const FilePath::CharType kRemotingViewerPluginPath[] = |
| 57 FILE_PATH_LITERAL("internal-remoting-viewer"); | 67 FILE_PATH_LITERAL("internal-remoting-viewer"); |
| 58 // Use a consistent MIME-type regardless of branding. | 68 // Use a consistent MIME-type regardless of branding. |
| 59 const char kRemotingViewerPluginMimeType[] = | 69 const char kRemotingViewerPluginMimeType[] = |
| 60 "application/vnd.chromium.remoting-viewer"; | 70 "application/vnd.chromium.remoting-viewer"; |
| 61 // TODO(wez): Remove the old MIME-type once client code no longer needs it. | 71 // TODO(wez): Remove the old MIME-type once client code no longer needs it. |
| 62 const char kRemotingViewerPluginOldMimeType[] = | 72 const char kRemotingViewerPluginOldMimeType[] = |
| 63 "pepper-application/x-chromoting"; | 73 "pepper-application/x-chromoting"; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 webkit::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, | 120 webkit::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, |
| 111 kNaClPluginExtension, | 121 kNaClPluginExtension, |
| 112 kNaClPluginDescription); | 122 kNaClPluginDescription); |
| 113 nacl.mime_types.push_back(nacl_mime_type); | 123 nacl.mime_types.push_back(nacl_mime_type); |
| 114 plugins->push_back(nacl); | 124 plugins->push_back(nacl); |
| 115 | 125 |
| 116 skip_nacl_file_check = true; | 126 skip_nacl_file_check = true; |
| 117 } | 127 } |
| 118 } | 128 } |
| 119 | 129 |
| 130 static bool skip_o3d_file_check = false; |
| 131 if (PathService::Get(chrome::FILE_O3D_PLUGIN, &path)) { |
| 132 if (skip_o3d_file_check || file_util::PathExists(path)) { |
| 133 content::PepperPluginInfo o3d; |
| 134 o3d.path = path; |
| 135 o3d.name = kO3DPluginName; |
| 136 o3d.is_out_of_process = true; |
| 137 o3d.is_sandboxed = false; |
| 138 webkit::WebPluginMimeType o3d_mime_type(kO3DPluginMimeType, |
| 139 kO3DPluginExtension, |
| 140 kO3DPluginDescription); |
| 141 o3d.mime_types.push_back(o3d_mime_type); |
| 142 plugins->push_back(o3d); |
| 143 |
| 144 skip_o3d_file_check = true; |
| 145 } |
| 146 } |
| 147 |
| 148 static bool skip_gtalk_file_check = false; |
| 149 if (PathService::Get(chrome::FILE_GTALK_PLUGIN, &path)) { |
| 150 if (skip_gtalk_file_check || file_util::PathExists(path)) { |
| 151 content::PepperPluginInfo gtalk; |
| 152 gtalk.path = path; |
| 153 gtalk.name = kGTalkPluginName; |
| 154 gtalk.is_out_of_process = true; |
| 155 gtalk.is_sandboxed = false; |
| 156 webkit::WebPluginMimeType gtalk_mime_type(kGTalkPluginMimeType, |
| 157 kGTalkPluginExtension, |
| 158 kGTalkPluginDescription); |
| 159 gtalk.mime_types.push_back(gtalk_mime_type); |
| 160 plugins->push_back(gtalk); |
| 161 |
| 162 skip_gtalk_file_check = true; |
| 163 } |
| 164 } |
| 165 |
| 120 // The Remoting Viewer plugin is built-in. | 166 // The Remoting Viewer plugin is built-in. |
| 121 #if defined(ENABLE_REMOTING) | 167 #if defined(ENABLE_REMOTING) |
| 122 content::PepperPluginInfo info; | 168 content::PepperPluginInfo info; |
| 123 info.is_internal = true; | 169 info.is_internal = true; |
| 124 info.name = kRemotingViewerPluginName; | 170 info.name = kRemotingViewerPluginName; |
| 125 info.path = FilePath(kRemotingViewerPluginPath); | 171 info.path = FilePath(kRemotingViewerPluginPath); |
| 126 webkit::WebPluginMimeType remoting_mime_type( | 172 webkit::WebPluginMimeType remoting_mime_type( |
| 127 kRemotingViewerPluginMimeType, | 173 kRemotingViewerPluginMimeType, |
| 128 std::string(), | 174 std::string(), |
| 129 std::string()); | 175 std::string()); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 DCHECK(sandbox_profile_resource_id); | 455 DCHECK(sandbox_profile_resource_id); |
| 410 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { | 456 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { |
| 411 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 457 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
| 412 return true; | 458 return true; |
| 413 } | 459 } |
| 414 return false; | 460 return false; |
| 415 } | 461 } |
| 416 #endif | 462 #endif |
| 417 | 463 |
| 418 } // namespace chrome | 464 } // namespace chrome |
| OLD | NEW |