| 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/utf_string_conversions.h" |
| 16 #include "base/win/windows_version.h" | 16 #include "base/win/windows_version.h" |
| 17 #include "chrome/common/child_process_logging.h" | 17 #include "chrome/common/child_process_logging.h" |
| 18 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/chrome_version_info.h" | 20 #include "chrome/common/chrome_version_info.h" |
| 21 #include "chrome/common/render_messages.h" | 21 #include "chrome/common/render_messages.h" |
| 22 #include "chrome/default_plugin/plugin_main.h" | 22 #include "chrome/default_plugin/plugin_main.h" |
| 23 #include "content/public/common/pepper_plugin_info.h" | 23 #include "content/public/common/pepper_plugin_info.h" |
| 24 #include "grit/common_resources.h" |
| 24 #include "remoting/client/plugin/pepper_entrypoints.h" | 25 #include "remoting/client/plugin/pepper_entrypoints.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 26 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 27 #include "webkit/glue/user_agent.h" | 28 #include "webkit/glue/user_agent.h" |
| 28 #include "webkit/plugins/npapi/plugin_list.h" | 29 #include "webkit/plugins/npapi/plugin_list.h" |
| 29 #include "webkit/plugins/plugin_constants.h" | 30 #include "webkit/plugins/plugin_constants.h" |
| 30 | 31 |
| 31 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 32 #include "sandbox/src/sandbox.h" | 33 #include "sandbox/src/sandbox.h" |
| 34 #elif defined(OS_MACOSX) |
| 35 #include "chrome/common/chrome_sandbox_process_type_mac.h" |
| 33 #endif | 36 #endif |
| 34 | 37 |
| 35 namespace { | 38 namespace { |
| 36 | 39 |
| 37 const char kPDFPluginName[] = "Chrome PDF Viewer"; | 40 const char kPDFPluginName[] = "Chrome PDF Viewer"; |
| 38 const char kPDFPluginMimeType[] = "application/pdf"; | 41 const char kPDFPluginMimeType[] = "application/pdf"; |
| 39 const char kPDFPluginExtension[] = "pdf"; | 42 const char kPDFPluginExtension[] = "pdf"; |
| 40 const char kPDFPluginDescription[] = "Portable Document Format"; | 43 const char kPDFPluginDescription[] = "Portable Document Format"; |
| 41 const char kPDFPluginPrintPreviewMimeType | 44 const char kPDFPluginPrintPreviewMimeType |
| 42 [] = "application/x-google-chrome-print-preview-pdf"; | 45 [] = "application/x-google-chrome-print-preview-pdf"; |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 DLOG(WARNING) << "Failed to start flash broker"; | 399 DLOG(WARNING) << "Failed to start flash broker"; |
| 397 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); | 400 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); |
| 398 policy->SetTokenLevel( | 401 policy->SetTokenLevel( |
| 399 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); | 402 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); |
| 400 } | 403 } |
| 401 | 404 |
| 402 return true; | 405 return true; |
| 403 } | 406 } |
| 404 #endif | 407 #endif |
| 405 | 408 |
| 409 #if defined(OS_MACOSX) |
| 410 int ChromeContentClient::GetSandboxPolicyForSandboxType( |
| 411 int sandbox_type) const { |
| 412 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) |
| 413 return IDR_NACL_SANDBOX_POLICY; |
| 414 return -1; |
| 415 } |
| 416 #endif |
| 417 |
| 406 } // namespace chrome | 418 } // namespace chrome |
| OLD | NEW |