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 #if defined(OS_POSIX) && !defined(OS_MACOSX) | |
55 const char kO3DPluginName[] = "Google Talk Plugin Video Accelerator"; | |
56 const char kO3DPluginMimeType[] ="application/vnd.o3d.auto"; | |
57 #if !defined(OS_CHROMEOS) | |
58 const char kGTO3DPluginMimeType[] = "application/vnd.gtpo3d.auto"; | |
piman
2011/12/13 01:48:02
Do we really need different mime types? Can't we j
Josh Horwich
2011/12/13 22:06:30
Done. I've consolidated it to one MIME type now.
| |
59 #endif // !defined(CHROMEOS) | |
60 const char kO3DPluginExtension[] = ""; | |
61 const char kO3DPluginDescription[] = "O3D MIME"; | |
62 | |
63 const char kGTalkPluginName[] = "Google Talk Plugin"; | |
64 const char kGTalkPluginMimeType[] ="application/googletalk"; | |
65 const char kGTalkPluginExtension[] = ".googletalk"; | |
66 const char kGTalkPluginDescription[] = "Google Talk Plugin"; | |
67 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | |
68 | |
54 #if defined(ENABLE_REMOTING) | 69 #if defined(ENABLE_REMOTING) |
55 const char kRemotingViewerPluginName[] = "Remoting Viewer"; | 70 const char kRemotingViewerPluginName[] = "Remoting Viewer"; |
56 const FilePath::CharType kRemotingViewerPluginPath[] = | 71 const FilePath::CharType kRemotingViewerPluginPath[] = |
57 FILE_PATH_LITERAL("internal-remoting-viewer"); | 72 FILE_PATH_LITERAL("internal-remoting-viewer"); |
58 // Use a consistent MIME-type regardless of branding. | 73 // Use a consistent MIME-type regardless of branding. |
59 const char kRemotingViewerPluginMimeType[] = | 74 const char kRemotingViewerPluginMimeType[] = |
60 "application/vnd.chromium.remoting-viewer"; | 75 "application/vnd.chromium.remoting-viewer"; |
61 // TODO(wez): Remove the old MIME-type once client code no longer needs it. | 76 // TODO(wez): Remove the old MIME-type once client code no longer needs it. |
62 const char kRemotingViewerPluginOldMimeType[] = | 77 const char kRemotingViewerPluginOldMimeType[] = |
63 "pepper-application/x-chromoting"; | 78 "pepper-application/x-chromoting"; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 webkit::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, | 125 webkit::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, |
111 kNaClPluginExtension, | 126 kNaClPluginExtension, |
112 kNaClPluginDescription); | 127 kNaClPluginDescription); |
113 nacl.mime_types.push_back(nacl_mime_type); | 128 nacl.mime_types.push_back(nacl_mime_type); |
114 plugins->push_back(nacl); | 129 plugins->push_back(nacl); |
115 | 130 |
116 skip_nacl_file_check = true; | 131 skip_nacl_file_check = true; |
117 } | 132 } |
118 } | 133 } |
119 | 134 |
135 #if defined(OS_POSIX) && !defined(OS_MACOSX) | |
136 static bool skip_o3d_file_check = false; | |
137 if (PathService::Get(chrome::FILE_O3D_PLUGIN, &path)) { | |
138 if (skip_o3d_file_check || file_util::PathExists(path)) { | |
139 content::PepperPluginInfo o3d; | |
140 o3d.path = path; | |
141 o3d.name = kO3DPluginName; | |
142 o3d.is_out_of_process = true; | |
143 o3d.is_sandboxed = false; | |
144 webkit::WebPluginMimeType o3d_mime_type(kO3DPluginMimeType, | |
145 kO3DPluginExtension, | |
146 kO3DPluginDescription); | |
147 o3d.mime_types.push_back(o3d_mime_type); | |
148 #if !defined(OS_CHROMEOS) | |
149 webkit::WebPluginMimeType gto3d_mime_type(kGTO3DPluginMimeType, | |
150 kO3DPluginExtension, | |
151 kO3DPluginDescription); | |
152 o3d.mime_types.push_back(gto3d_mime_type); | |
153 #endif // !defined(OS_CHROMEOS) | |
154 plugins->push_back(o3d); | |
155 | |
156 skip_o3d_file_check = true; | |
157 } | |
158 } | |
159 | |
160 static bool skip_gtalk_file_check = false; | |
161 if (PathService::Get(chrome::FILE_GTALK_PLUGIN, &path)) { | |
162 if (skip_gtalk_file_check || file_util::PathExists(path)) { | |
163 content::PepperPluginInfo gtalk; | |
164 gtalk.path = path; | |
165 gtalk.name = kGTalkPluginName; | |
166 gtalk.is_out_of_process = true; | |
167 gtalk.is_sandboxed = false; | |
168 webkit::WebPluginMimeType gtalk_mime_type(kGTalkPluginMimeType, | |
169 kGTalkPluginExtension, | |
170 kGTalkPluginDescription); | |
171 gtalk.mime_types.push_back(gtalk_mime_type); | |
172 plugins->push_back(gtalk); | |
173 | |
174 skip_gtalk_file_check = true; | |
175 } | |
176 } | |
177 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | |
178 | |
120 // The Remoting Viewer plugin is built-in. | 179 // The Remoting Viewer plugin is built-in. |
121 #if defined(ENABLE_REMOTING) | 180 #if defined(ENABLE_REMOTING) |
122 content::PepperPluginInfo info; | 181 content::PepperPluginInfo info; |
123 info.is_internal = true; | 182 info.is_internal = true; |
124 info.name = kRemotingViewerPluginName; | 183 info.name = kRemotingViewerPluginName; |
125 info.path = FilePath(kRemotingViewerPluginPath); | 184 info.path = FilePath(kRemotingViewerPluginPath); |
126 webkit::WebPluginMimeType remoting_mime_type( | 185 webkit::WebPluginMimeType remoting_mime_type( |
127 kRemotingViewerPluginMimeType, | 186 kRemotingViewerPluginMimeType, |
128 std::string(), | 187 std::string(), |
129 std::string()); | 188 std::string()); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 DCHECK(sandbox_profile_resource_id); | 468 DCHECK(sandbox_profile_resource_id); |
410 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { | 469 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { |
411 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 470 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
412 return true; | 471 return true; |
413 } | 472 } |
414 return false; | 473 return false; |
415 } | 474 } |
416 #endif | 475 #endif |
417 | 476 |
418 } // namespace chrome | 477 } // namespace chrome |
OLD | NEW |