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/utf_string_conversions.h" |
15 #include "base/win/windows_version.h" | 16 #include "base/win/windows_version.h" |
16 #include "chrome/common/child_process_logging.h" | 17 #include "chrome/common/child_process_logging.h" |
17 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/chrome_version_info.h" | 20 #include "chrome/common/chrome_version_info.h" |
20 #include "chrome/common/render_messages.h" | 21 #include "chrome/common/render_messages.h" |
| 22 #include "chrome/default_plugin/plugin_main.h" |
21 #include "content/public/common/pepper_plugin_info.h" | 23 #include "content/public/common/pepper_plugin_info.h" |
22 #include "remoting/client/plugin/pepper_entrypoints.h" | 24 #include "remoting/client/plugin/pepper_entrypoints.h" |
23 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
24 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
25 #include "webkit/glue/user_agent.h" | 27 #include "webkit/glue/user_agent.h" |
| 28 #include "webkit/plugins/npapi/plugin_list.h" |
26 #include "webkit/plugins/plugin_constants.h" | 29 #include "webkit/plugins/plugin_constants.h" |
27 | 30 |
28 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
29 #include "sandbox/src/sandbox.h" | 32 #include "sandbox/src/sandbox.h" |
30 #endif | 33 #endif |
31 | 34 |
32 namespace { | 35 namespace { |
33 | 36 |
34 const char kPDFPluginName[] = "Chrome PDF Viewer"; | 37 const char kPDFPluginName[] = "Chrome PDF Viewer"; |
35 const char kPDFPluginMimeType[] = "application/pdf"; | 38 const char kPDFPluginMimeType[] = "application/pdf"; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 void ChromeContentClient::SetGpuInfo(const content::GPUInfo& gpu_info) { | 262 void ChromeContentClient::SetGpuInfo(const content::GPUInfo& gpu_info) { |
260 child_process_logging::SetGpuInfo(gpu_info); | 263 child_process_logging::SetGpuInfo(gpu_info); |
261 } | 264 } |
262 | 265 |
263 void ChromeContentClient::AddPepperPlugins( | 266 void ChromeContentClient::AddPepperPlugins( |
264 std::vector<content::PepperPluginInfo>* plugins) { | 267 std::vector<content::PepperPluginInfo>* plugins) { |
265 ComputeBuiltInPlugins(plugins); | 268 ComputeBuiltInPlugins(plugins); |
266 AddOutOfProcessFlash(plugins); | 269 AddOutOfProcessFlash(plugins); |
267 } | 270 } |
268 | 271 |
| 272 void ChromeContentClient::AddNPAPIPlugins( |
| 273 webkit::npapi::PluginList* plugin_list) { |
| 274 #if defined(OS_WIN) && !defined(USE_AURA) |
| 275 // TODO(bauerb): On Windows the default plug-in can download and install |
| 276 // missing plug-ins, which we don't support in the browser yet, so keep |
| 277 // using the default plug-in on Windows until we do. |
| 278 // Aura isn't going to support NPAPI plugins. |
| 279 const webkit::npapi::PluginEntryPoints entry_points = { |
| 280 default_plugin::NP_GetEntryPoints, |
| 281 default_plugin::NP_Initialize, |
| 282 default_plugin::NP_Shutdown |
| 283 }; |
| 284 |
| 285 webkit::WebPluginInfo info; |
| 286 info.path = FilePath(webkit::npapi::kDefaultPluginLibraryName); |
| 287 info.name = ASCIIToUTF16("Default Plug-in"); |
| 288 info.version = ASCIIToUTF16("1"); |
| 289 info.desc = ASCIIToUTF16("Provides functionality for installing third-party " |
| 290 "plug-ins"); |
| 291 |
| 292 webkit::WebPluginMimeType mimeType; |
| 293 mimeType.mime_type = "*"; |
| 294 info.mime_types.push_back(mimeType); |
| 295 |
| 296 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( |
| 297 info, |
| 298 entry_points, |
| 299 false); |
| 300 #endif |
| 301 } |
| 302 |
269 bool ChromeContentClient::CanSendWhileSwappedOut(const IPC::Message* msg) { | 303 bool ChromeContentClient::CanSendWhileSwappedOut(const IPC::Message* msg) { |
270 // Any Chrome-specific messages that must be allowed to be sent from swapped | 304 // Any Chrome-specific messages that must be allowed to be sent from swapped |
271 // out renderers. | 305 // out renderers. |
272 switch (msg->type()) { | 306 switch (msg->type()) { |
273 case ChromeViewHostMsg_DomOperationResponse::ID: | 307 case ChromeViewHostMsg_DomOperationResponse::ID: |
274 return true; | 308 return true; |
275 default: | 309 default: |
276 break; | 310 break; |
277 } | 311 } |
278 return false; | 312 return false; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); | 397 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); |
364 policy->SetTokenLevel( | 398 policy->SetTokenLevel( |
365 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); | 399 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); |
366 } | 400 } |
367 | 401 |
368 return true; | 402 return true; |
369 } | 403 } |
370 #endif | 404 #endif |
371 | 405 |
372 } // namespace chrome | 406 } // namespace chrome |
OLD | NEW |