| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/common/crash_keys.h" | 22 #include "chrome/common/crash_keys.h" |
| 23 #include "chrome/common/render_messages.h" | 23 #include "chrome/common/render_messages.h" |
| 24 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
| 25 #include "chrome/grit/common_resources.h" | 25 #include "chrome/grit/common_resources.h" |
| 26 #include "components/dom_distiller/core/url_constants.h" | 26 #include "components/dom_distiller/core/url_constants.h" |
| 27 #include "content/public/common/content_constants.h" | 27 #include "content/public/common/content_constants.h" |
| 28 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
| 29 #include "content/public/common/url_constants.h" | 29 #include "content/public/common/url_constants.h" |
| 30 #include "content/public/common/user_agent.h" | 30 #include "content/public/common/user_agent.h" |
| 31 #include "extensions/common/constants.h" | 31 #include "extensions/common/constants.h" |
| 32 #include "extensions/common/feature_switch.h" |
| 32 #include "gpu/config/gpu_info.h" | 33 #include "gpu/config/gpu_info.h" |
| 33 #include "net/http/http_util.h" | 34 #include "net/http/http_util.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
| 35 #include "ui/base/layout.h" | 36 #include "ui/base/layout.h" |
| 36 #include "ui/base/resource/resource_bundle.h" | 37 #include "ui/base/resource/resource_bundle.h" |
| 37 | 38 |
| 38 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 39 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
| 39 | 40 |
| 40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 41 #include "base/win/registry.h" | 42 #include "base/win/registry.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // check on subsequent calls if yes. | 135 // check on subsequent calls if yes. |
| 135 static bool skip_pdf_file_check = false; | 136 static bool skip_pdf_file_check = false; |
| 136 base::FilePath path; | 137 base::FilePath path; |
| 137 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) { | 138 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) { |
| 138 if (skip_pdf_file_check || base::PathExists(path)) { | 139 if (skip_pdf_file_check || base::PathExists(path)) { |
| 139 content::PepperPluginInfo pdf; | 140 content::PepperPluginInfo pdf; |
| 140 pdf.path = path; | 141 pdf.path = path; |
| 141 pdf.name = ChromeContentClient::kPDFPluginName; | 142 pdf.name = ChromeContentClient::kPDFPluginName; |
| 142 if (CommandLine::ForCurrentProcess()->HasSwitch( | 143 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 143 switches::kOutOfProcessPdf)) { | 144 switches::kOutOfProcessPdf)) { |
| 145 // Always enable the MIME handler view flag for OOP PDF. |
| 146 extensions::FeatureSwitch::mime_handler_view()->SetOverrideValue( |
| 147 extensions::FeatureSwitch::OVERRIDE_ENABLED); |
| 144 pdf.is_out_of_process = true; | 148 pdf.is_out_of_process = true; |
| 145 content::WebPluginMimeType pdf_mime_type(kPDFPluginOutOfProcessMimeType, | 149 content::WebPluginMimeType pdf_mime_type(kPDFPluginOutOfProcessMimeType, |
| 146 kPDFPluginExtension, | 150 kPDFPluginExtension, |
| 147 kPDFPluginDescription); | 151 kPDFPluginDescription); |
| 148 pdf.mime_types.push_back(pdf_mime_type); | 152 pdf.mime_types.push_back(pdf_mime_type); |
| 149 // TODO(raymes): Make print preview work with out of process PDF. | 153 // TODO(raymes): Make print preview work with out of process PDF. |
| 150 } else { | 154 } else { |
| 151 content::WebPluginMimeType pdf_mime_type(kPDFPluginMimeType, | 155 content::WebPluginMimeType pdf_mime_type(kPDFPluginMimeType, |
| 152 kPDFPluginExtension, | 156 kPDFPluginExtension, |
| 153 kPDFPluginDescription); | 157 kPDFPluginDescription); |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 int sandbox_type, | 540 int sandbox_type, |
| 537 int* sandbox_profile_resource_id) const { | 541 int* sandbox_profile_resource_id) const { |
| 538 DCHECK(sandbox_profile_resource_id); | 542 DCHECK(sandbox_profile_resource_id); |
| 539 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { | 543 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { |
| 540 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 544 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
| 541 return true; | 545 return true; |
| 542 } | 546 } |
| 543 return false; | 547 return false; |
| 544 } | 548 } |
| 545 #endif | 549 #endif |
| OLD | NEW |