summaryrefslogtreecommitdiffstats
path: root/chrome/common/pepper_plugin_registry.cc
diff options
context:
space:
mode:
authorgene@chromium.org <gene@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 21:16:23 +0000
committergene@chromium.org <gene@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 21:16:23 +0000
commit57b3e83ee8556aaa23a3c31765789268a9a94cea (patch)
treeaeb347c9f09bca7b109755c78cb304132b4e9f4b /chrome/common/pepper_plugin_registry.cc
parentc2df6bd4e5d3fced439af6e81d219d4d048011ef (diff)
downloadchromium_src-57b3e83ee8556aaa23a3c31765789268a9a94cea.zip
chromium_src-57b3e83ee8556aaa23a3c31765789268a9a94cea.tar.gz
chromium_src-57b3e83ee8556aaa23a3c31765789268a9a94cea.tar.bz2
Fix "missing plugin" error in linux chrome.
On linux first check succeeded, while next one will fail and no plugin information got returned. So, I am inverting logic a little bit. IFF check for plugin file succeeded, we omit all subsequent for this file in the process. BUG=none TEST=Check PDF plugin is working in Chrome linux sandbox, and no PDF plugin is in Chromium build. Review URL: http://codereview.chromium.org/3181003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/pepper_plugin_registry.cc')
-rw-r--r--chrome/common/pepper_plugin_registry.cc27
1 files changed, 13 insertions, 14 deletions
diff --git a/chrome/common/pepper_plugin_registry.cc b/chrome/common/pepper_plugin_registry.cc
index 78a2286..7ba71e2 100644
--- a/chrome/common/pepper_plugin_registry.cc
+++ b/chrome/common/pepper_plugin_registry.cc
@@ -105,22 +105,21 @@ void PepperPluginRegistry::GetExtraPlugins(
// available or not; but (on Linux) 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;
+ // if yes.
+ static bool skip_pdf_file_check = false;
FilePath path;
- if (!skip_pdf_plugin && PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) {
- if (!file_util::PathExists(path)) {
- skip_pdf_plugin = true;
- return;
+ if (PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) {
+ if (skip_pdf_file_check || file_util::PathExists(path)) {
+ PepperPluginInfo pdf;
+ pdf.path = path;
+ pdf.name = "Chrome PDF Viewer";
+ pdf.mime_types.push_back("application/pdf");
+ pdf.file_extensions = "pdf";
+ pdf.type_descriptions = "Portable Document Format";
+ plugins->push_back(pdf);
+
+ skip_pdf_file_check = true;
}
-
- PepperPluginInfo pdf;
- pdf.path = path;
- pdf.name = "Chrome PDF Viewer";
- pdf.mime_types.push_back("application/pdf");
- pdf.file_extensions = "pdf";
- pdf.type_descriptions = "Portable Document Format";
- plugins->push_back(pdf);
}
}