| Index: chrome/common/pepper_plugin_registry.cc
|
| diff --git a/chrome/common/pepper_plugin_registry.cc b/chrome/common/pepper_plugin_registry.cc
|
| index 7caf9c9403bcc9cc3e41b20258230d545872f060..ca4bf4299d601f9ba03725cd60e2e85029708602 100644
|
| --- a/chrome/common/pepper_plugin_registry.cc
|
| +++ b/chrome/common/pepper_plugin_registry.cc
|
| @@ -101,11 +101,18 @@ void PepperPluginRegistry::GetPluginInfoFromSwitch(
|
| // static
|
| void PepperPluginRegistry::GetExtraPlugins(
|
| std::vector<PepperPluginInfo>* plugins) {
|
| + // Once we're sandboxed, we can't know if the PDF plugin is
|
| + // available or not; but this function is always called once before
|
| + // we're sandboxed. So the first time through test if the file is
|
| + // available and then skip the check on subsequent calls if not.
|
| + static bool skip_pdf_plugin = false;
|
| FilePath path;
|
| - // We can't check for path existance here, since we are in the sandbox.
|
| - // If plugin is missing, it will later fail to
|
| - // load the library and the missing plugin message will be displayed.
|
| - if (PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) {
|
| + if (!skip_pdf_plugin && PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) {
|
| + if (!file_util::PathExists(path)) {
|
| + skip_pdf_plugin = true;
|
| + return;
|
| + }
|
| +
|
| PepperPluginInfo pdf;
|
| pdf.path = path;
|
| pdf.name = "Chrome PDF Viewer";
|
|
|