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

Unified Diff: chrome/common/pepper_plugin_registry.cc

Issue 3114005: pepper: don't warn if PDF plugin is unavailable (Closed)
Patch Set: revert Created 10 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
viettrungluu 2010/08/10 19:29:29 You should probably note that this applies to Linu
+ // 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";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698