Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 756653005: Change the flag which enables OOP PDF to an enable/disable flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/pdf/pdf_extension_test.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // but (on Linux) this function is always called once before we're sandboxed. 132 // but (on Linux) this function is always called once before we're sandboxed.
133 // So the first time through test if the file is available and then skip the 133 // So the first time through test if the file is available and then skip the
134 // check on subsequent calls if yes. 134 // check on subsequent calls if yes.
135 static bool skip_pdf_file_check = false; 135 static bool skip_pdf_file_check = false;
136 base::FilePath path; 136 base::FilePath path;
137 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) { 137 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) {
138 if (skip_pdf_file_check || base::PathExists(path)) { 138 if (skip_pdf_file_check || base::PathExists(path)) {
139 content::PepperPluginInfo pdf; 139 content::PepperPluginInfo pdf;
140 pdf.path = path; 140 pdf.path = path;
141 pdf.name = ChromeContentClient::kPDFPluginName; 141 pdf.name = ChromeContentClient::kPDFPluginName;
142 if (CommandLine::ForCurrentProcess()->HasSwitch( 142 if (switches::OutOfProcessPdfEnabled()) {
143 switches::kOutOfProcessPdf)) {
144 pdf.is_out_of_process = true; 143 pdf.is_out_of_process = true;
145 content::WebPluginMimeType pdf_mime_type(kPDFPluginOutOfProcessMimeType, 144 content::WebPluginMimeType pdf_mime_type(kPDFPluginOutOfProcessMimeType,
146 kPDFPluginExtension, 145 kPDFPluginExtension,
147 kPDFPluginDescription); 146 kPDFPluginDescription);
148 pdf.mime_types.push_back(pdf_mime_type); 147 pdf.mime_types.push_back(pdf_mime_type);
149 // TODO(raymes): Make print preview work with out of process PDF. 148 // TODO(raymes): Make print preview work with out of process PDF.
150 } else { 149 } else {
151 content::WebPluginMimeType pdf_mime_type(kPDFPluginMimeType, 150 content::WebPluginMimeType pdf_mime_type(kPDFPluginMimeType,
152 kPDFPluginExtension, 151 kPDFPluginExtension,
153 kPDFPluginDescription); 152 kPDFPluginDescription);
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 int sandbox_type, 534 int sandbox_type,
536 int* sandbox_profile_resource_id) const { 535 int* sandbox_profile_resource_id) const {
537 DCHECK(sandbox_profile_resource_id); 536 DCHECK(sandbox_profile_resource_id);
538 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { 537 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) {
539 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; 538 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE;
540 return true; 539 return true;
541 } 540 }
542 return false; 541 return false;
543 } 542 }
544 #endif 543 #endif
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/pdf_extension_test.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698